mirror of
https://github.com/minio/minio.git
synced 2025-11-09 13:39:46 -05:00
Update madmin package to return storage class parity (#5387)
After the addition of Storage Class support, readQuorum and writeQuorum are decided on a per object basis, instead of deployment wide static quorums. This PR updates madmin api to remove readQuorum/writeQuorum and add Standard storage class and reduced redundancy storage class parity as return values. Since these parity values are used to decide the quorum for each object. Fixes #5378
This commit is contained in:
@@ -45,8 +45,8 @@ type StorageInfo struct {
|
||||
// Following fields are only meaningful if BackendType is Erasure.
|
||||
OnlineDisks int // Online disks during server startup.
|
||||
OfflineDisks int // Offline disks during server startup.
|
||||
standardSCParity int // Parity disks for currently configured Standard storage class.
|
||||
rrSCParity int // Parity disks for currently configured Reduced Redundancy storage class.
|
||||
StandardSCParity int // Parity disks for currently configured Standard storage class.
|
||||
RRSCParity int // Parity disks for currently configured Reduced Redundancy storage class.
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -197,7 +197,7 @@ func printStorageClassInfoMsg(storageInfo StorageInfo) {
|
||||
|
||||
func getStandardStorageClassInfoMsg(storageInfo StorageInfo) string {
|
||||
var msg string
|
||||
if maxDiskFailures := storageInfo.Backend.standardSCParity - storageInfo.Backend.OfflineDisks; maxDiskFailures >= 0 {
|
||||
if maxDiskFailures := storageInfo.Backend.StandardSCParity - storageInfo.Backend.OfflineDisks; maxDiskFailures >= 0 {
|
||||
msg += fmt.Sprintf("Objects with "+standardStorageClass+" class can withstand [%d] drive failure(s).\n", maxDiskFailures)
|
||||
}
|
||||
return msg
|
||||
@@ -205,7 +205,7 @@ func getStandardStorageClassInfoMsg(storageInfo StorageInfo) string {
|
||||
|
||||
func getRRSStorageClassInfoMsg(storageInfo StorageInfo) string {
|
||||
var msg string
|
||||
if maxDiskFailures := storageInfo.Backend.rrSCParity - storageInfo.Backend.OfflineDisks; maxDiskFailures >= 0 {
|
||||
if maxDiskFailures := storageInfo.Backend.RRSCParity - storageInfo.Backend.OfflineDisks; maxDiskFailures >= 0 {
|
||||
msg += fmt.Sprintf("Objects with "+reducedRedundancyStorageClass+" class can withstand [%d] drive failure(s).\n", maxDiskFailures)
|
||||
}
|
||||
return msg
|
||||
|
||||
@@ -38,8 +38,8 @@ func TestStorageInfoMsg(t *testing.T) {
|
||||
Type BackendType
|
||||
OnlineDisks int
|
||||
OfflineDisks int
|
||||
standardSCParity int
|
||||
rrSCParity int
|
||||
StandardSCParity int
|
||||
RRSCParity int
|
||||
}{Erasure, 7, 1, 4, 5},
|
||||
}
|
||||
|
||||
@@ -169,8 +169,8 @@ func TestGetStandardStorageClassInfoMsg(t *testing.T) {
|
||||
Type BackendType
|
||||
OnlineDisks int
|
||||
OfflineDisks int
|
||||
standardSCParity int
|
||||
rrSCParity int
|
||||
StandardSCParity int
|
||||
RRSCParity int
|
||||
}{Erasure, 15, 1, 5, 3},
|
||||
}, "Objects with " + standardStorageClass + " class can withstand [4] drive failure(s).\n"},
|
||||
{"2", StorageInfo{
|
||||
@@ -180,8 +180,8 @@ func TestGetStandardStorageClassInfoMsg(t *testing.T) {
|
||||
Type BackendType
|
||||
OnlineDisks int
|
||||
OfflineDisks int
|
||||
standardSCParity int
|
||||
rrSCParity int
|
||||
StandardSCParity int
|
||||
RRSCParity int
|
||||
}{Erasure, 10, 0, 5, 3},
|
||||
}, "Objects with " + standardStorageClass + " class can withstand [5] drive failure(s).\n"},
|
||||
{"3", StorageInfo{
|
||||
@@ -191,8 +191,8 @@ func TestGetStandardStorageClassInfoMsg(t *testing.T) {
|
||||
Type BackendType
|
||||
OnlineDisks int
|
||||
OfflineDisks int
|
||||
standardSCParity int
|
||||
rrSCParity int
|
||||
StandardSCParity int
|
||||
RRSCParity int
|
||||
}{Erasure, 12, 3, 6, 2},
|
||||
}, "Objects with " + standardStorageClass + " class can withstand [3] drive failure(s).\n"},
|
||||
}
|
||||
@@ -216,8 +216,8 @@ func TestGetRRSStorageClassInfoMsg(t *testing.T) {
|
||||
Type BackendType
|
||||
OnlineDisks int
|
||||
OfflineDisks int
|
||||
standardSCParity int
|
||||
rrSCParity int
|
||||
StandardSCParity int
|
||||
RRSCParity int
|
||||
}{Erasure, 15, 1, 5, 3},
|
||||
}, "Objects with " + reducedRedundancyStorageClass + " class can withstand [2] drive failure(s).\n"},
|
||||
{"2", StorageInfo{
|
||||
@@ -227,8 +227,8 @@ func TestGetRRSStorageClassInfoMsg(t *testing.T) {
|
||||
Type BackendType
|
||||
OnlineDisks int
|
||||
OfflineDisks int
|
||||
standardSCParity int
|
||||
rrSCParity int
|
||||
StandardSCParity int
|
||||
RRSCParity int
|
||||
}{Erasure, 16, 0, 5, 3},
|
||||
}, "Objects with " + reducedRedundancyStorageClass + " class can withstand [3] drive failure(s).\n"},
|
||||
{"3", StorageInfo{
|
||||
@@ -238,8 +238,8 @@ func TestGetRRSStorageClassInfoMsg(t *testing.T) {
|
||||
Type BackendType
|
||||
OnlineDisks int
|
||||
OfflineDisks int
|
||||
standardSCParity int
|
||||
rrSCParity int
|
||||
StandardSCParity int
|
||||
RRSCParity int
|
||||
}{Erasure, 12, 3, 6, 5},
|
||||
}, "Objects with " + reducedRedundancyStorageClass + " class can withstand [2] drive failure(s).\n"},
|
||||
}
|
||||
|
||||
@@ -247,10 +247,10 @@ func getStorageInfo(disks []StorageAPI) StorageInfo {
|
||||
storageInfo.Backend.OfflineDisks = offlineDisks
|
||||
|
||||
_, scParity := getRedundancyCount(standardStorageClass, len(disks))
|
||||
storageInfo.Backend.standardSCParity = scParity
|
||||
storageInfo.Backend.StandardSCParity = scParity
|
||||
|
||||
_, rrSCparity := getRedundancyCount(reducedRedundancyStorageClass, len(disks))
|
||||
storageInfo.Backend.rrSCParity = rrSCparity
|
||||
storageInfo.Backend.RRSCParity = rrSCparity
|
||||
|
||||
return storageInfo
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user