fix(heal): bound read-repair object commit locks (#6839)

Co-authored-by: heihutu <heihutu@gmail.com>
This commit is contained in:
houseme
2026-08-29 15:48:18 +08:00
committed by GitHub
parent af6c229914
commit b5f9cbcee4
14 changed files with 560 additions and 75 deletions
+20
View File
@@ -213,6 +213,8 @@ pub struct HealOpts {
pub update_parity: bool,
#[serde(rename = "nolock")]
pub no_lock: bool,
#[serde(rename = "readRepair", default)]
pub read_repair: bool,
#[serde(rename = "pool", default)]
pub pool: Option<usize>,
#[serde(rename = "set", default)]
@@ -672,6 +674,24 @@ mod tests {
assert_eq!(request.source, HealRequestSource::Internal);
}
#[test]
fn heal_opts_deserializes_missing_read_repair_as_false() {
let opts: HealOpts = serde_json::from_str(
r#"{
"recursive": false,
"dryRun": false,
"remove": false,
"recreate": false,
"scanMode": "normal",
"updateParity": false,
"nolock": false
}"#,
)
.expect("old heal options without readRepair should decode");
assert!(!opts.read_repair);
}
#[test]
fn heal_admission_result_labels_are_stable() {
assert_eq!(HealAdmissionResult::Accepted.result_label(), "accepted");