mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-22 04:16:38 +00:00
feat(admin): make capacity calculation resilient when backend info is missing (#1560)
Signed-off-by: heihutu <30542132+heihutu@users.noreply.github.com> Signed-off-by: majinghe <42570491+majinghe@users.noreply.github.com> Co-authored-by: majinghe <42570491+majinghe@users.noreply.github.com> Co-authored-by: heihutu <30542132+heihutu@users.noreply.github.com>
This commit is contained in:
@@ -6817,10 +6817,17 @@ async fn get_storage_info(disks: &[Option<DiskStore>], eps: &[Endpoint]) -> rust
|
||||
let mut disks = get_disks_info(disks, eps).await;
|
||||
disks.sort_by(|a, b| a.total_space.cmp(&b.total_space));
|
||||
|
||||
// Provide minimal backend shape for callers. Do NOT guess parity here since it belongs to higher-level config.
|
||||
// Missing/empty standard_sc_data will be handled by capacity fallback logic.
|
||||
let drives_per_set = vec![eps.len()];
|
||||
let total_sets = vec![1];
|
||||
|
||||
rustfs_madmin::StorageInfo {
|
||||
disks,
|
||||
backend: rustfs_madmin::BackendInfo {
|
||||
backend_type: rustfs_madmin::BackendByte::Erasure,
|
||||
drives_per_set,
|
||||
total_sets,
|
||||
..Default::default()
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user