test get_format_file_in_quorum

This commit is contained in:
weisd
2024-09-11 15:19:59 +08:00
parent 35f0d7a82a
commit aa8135a1ad

View File

@@ -127,8 +127,15 @@ fn get_format_file_in_quorum(formats: &[Option<FormatV3>]) -> Result<FormatV3> {
let (max_drives, max_count) = countmap.iter().max_by_key(|&(_, c)| c).unwrap_or((&0, &0));
warn!("get_format_file_in_quorum fi: {:?}", &formats);
if *max_drives == 0 || *max_count < formats.len() / 2 {
warn!("*max_drives == 0 || *max_count < formats.len() / 2");
warn!(
"*max_drives == 0 || *max_count < formats.len() / 2, {} || {}<{}",
max_drives,
max_count,
formats.len() / 2
);
return Err(Error::new(ErasureError::ErasureReadQuorum));
}