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:
houseme
2026-01-20 13:03:09 +08:00
committed by GitHub
parent 14ce251e3b
commit 7c8fd8518f
2 changed files with 96 additions and 8 deletions
+7
View File
@@ -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()
},
}