mirror of
https://github.com/rustfs/rustfs.git
synced 2026-09-01 17:58:22 +00:00
fix(heal): bound read-repair object commit locks (#6839)
Co-authored-by: heihutu <heihutu@gmail.com>
This commit is contained in:
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user