mirror of
https://github.com/minio/minio.git
synced 2025-11-09 13:39:46 -05:00
Assume standard storage class if not set in metadata (#5370)
If STANDARD storage class is set before starting up Minio server, but x-amz-storage-class metadata field is not set in a PutObject request, Minio server defaults to N/2 data and N/2 parity disks. This PR changes the behaviour to use data and parity disks set in STANDARD storage class, even if x-amz-storage-class metadata field is not present in PutObject requests.
This commit is contained in:
@@ -173,6 +173,7 @@ func testGetRedundancyCount(obj ObjectLayer, instanceType string, dirs []string,
|
||||
{3, "", xl.storageDisks, 8, 8},
|
||||
{4, reducedRedundancyStorageClass, xl.storageDisks, 9, 7},
|
||||
{5, standardStorageClass, xl.storageDisks, 10, 6},
|
||||
{6, "", xl.storageDisks, 9, 7},
|
||||
}
|
||||
for _, tt := range tests {
|
||||
// Set env var for test case 4
|
||||
@@ -183,6 +184,10 @@ func testGetRedundancyCount(obj ObjectLayer, instanceType string, dirs []string,
|
||||
if tt.name == 5 {
|
||||
globalStandardStorageClass.Parity = 6
|
||||
}
|
||||
// Set env var for test case 6
|
||||
if tt.name == 6 {
|
||||
globalStandardStorageClass.Parity = 7
|
||||
}
|
||||
data, parity := getRedundancyCount(tt.sc, len(tt.disks))
|
||||
if data != tt.expectedData {
|
||||
t.Errorf("Test %d, Expected data disks %d, got %d", tt.name, tt.expectedData, data)
|
||||
|
||||
Reference in New Issue
Block a user