heal: reject dry-run object repair receipts

Do not record positive storage repair receipts for dry-run object heal tasks, even if a producer accidentally returns a matching receipt.

Co-Authored-By: heihutu <heihutu@gmail.com>

Co-Authored-By: zhi22915 <qiuzgang@gmail.com>
This commit is contained in:
houseme
2026-09-08 14:03:39 +08:00
parent 80321e5bb4
commit 817ad0a682
2 changed files with 15 additions and 0 deletions
+3
View File
@@ -609,6 +609,9 @@ impl HealTask {
expected: HealObjectIdentity,
receipt: Option<HealObjectReceipt>,
) -> bool {
if self.options.dry_run {
return false;
}
let Some(receipt) = receipt else {
return false;
};
+12
View File
@@ -386,6 +386,18 @@ mod canonical_outcome {
.lock()
.expect("existence fixture")
.insert("object".to_string(), MockObjectExists::TransientSkip("retry later"));
} else {
let incarnation = Uuid::new_v4();
*storage.bucket_incarnation_id.lock().expect("bucket incarnation") = Some(incarnation);
storage.heal_object_receipts.lock().expect("receipt fixture").insert(
"object".to_string(),
VecDeque::from([object_receipt(
"object",
None,
HealObjectDisposition::VerifiedHealthy,
incarnation,
)]),
);
}
let mut request = HealRequest::object("bucket-a".to_string(), "object".to_string(), None);
request.options.dry_run = !transient;