mirror of
https://github.com/pgsty/minio.git
synced 2026-07-21 21:20:23 +03:00
Better reporting of total/free usable capacity of the cluster (#15230)
The current code uses approximation using a ratio. The approximation can skew if we have multiple pools with different disk capacities. Replace the algorithm with a simpler one which counts data disks and ignore parity disks.
This commit is contained in:
+8
-2
@@ -209,7 +209,13 @@ func (fs *FSObjects) Shutdown(ctx context.Context) error {
|
||||
|
||||
// BackendInfo - returns backend information
|
||||
func (fs *FSObjects) BackendInfo() madmin.BackendInfo {
|
||||
return madmin.BackendInfo{Type: madmin.FS}
|
||||
return madmin.BackendInfo{
|
||||
Type: madmin.FS,
|
||||
StandardSCData: []int{1},
|
||||
StandardSCParity: 0,
|
||||
RRSCData: []int{1},
|
||||
RRSCParity: 0,
|
||||
}
|
||||
}
|
||||
|
||||
// LocalStorageInfo - returns underlying storage statistics.
|
||||
@@ -234,7 +240,7 @@ func (fs *FSObjects) StorageInfo(ctx context.Context) (StorageInfo, []error) {
|
||||
},
|
||||
},
|
||||
}
|
||||
storageInfo.Backend.Type = madmin.FS
|
||||
storageInfo.Backend = fs.BackendInfo()
|
||||
return storageInfo, nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user