fix(heal): preserve resumable retry signals (#6995)

This commit is contained in:
cxymds
2026-09-01 16:55:57 +08:00
committed by GitHub
parent b09ce8e6b5
commit cee84561e7
2 changed files with 32 additions and 0 deletions
@@ -492,6 +492,7 @@ impl HealTask {
}
Err(Error::TaskCancelled) => Err(Error::TaskCancelled),
Err(Error::TaskTimeout) => Err(Error::TaskTimeout),
Err(e) if e.is_recoverable_heal() => Err(e),
Err(e) => {
error!(
target: "rustfs::heal::task",
+31
View File
@@ -2428,6 +2428,37 @@ async fn erasure_set_format_slowdown_is_propagated() {
assert!(matches!(error, Error::Storage(EcstoreError::SlowDown)));
}
#[tokio::test]
async fn erasure_set_retry_signal_remains_typed_across_task_boundary() {
let temp = TempDir::new().expect("temporary directory should be created");
let disk = make_resume_disk(&temp).await;
let storage = Arc::new(MockStorage {
heal_object_outcome: Mutex::new(Some(MockHealObjectOutcome::RetryableSlowDown)),
resume_disk: Mutex::new(Some(disk)),
..Default::default()
});
let request = HealRequest::new(
HealType::ErasureSet {
buckets: vec!["bucket-a".to_string()],
set_disk_id: "pool_0_set_0".to_string(),
},
HealOptions::default(),
HealPriority::Normal,
);
let task = HealTask::from_request(request, storage);
let error = task
.execute()
.await
.expect_err("an incomplete resumable pass must remain retryable");
assert!(
matches!(&error, Error::TransientSkip { message } if message.contains("retry scheduled")),
"the resumable retry signal must keep its typed identity: {error}"
);
assert!(error.is_recoverable_heal(), "the scheduler must accept the preserved retry signal");
}
#[tokio::test]
async fn erasure_set_bucket_prepass_failure_stops_before_object_heal() {
let temp = TempDir::new().expect("temporary directory should be created");