mirror of
https://github.com/minio/minio.git
synced 2025-11-10 05:59:43 -05:00
objectLayer: Check for format.json in a wrapped disk. (#3311)
This is needed to validate if the `format.json` indeed exists when a fresh node is brought online. This wrapped implementation also connects to the remote node by attempting a re-login. Subsequently after a successful connect `format.json` is validated as well. Fixes #3207
This commit is contained in:
@@ -73,7 +73,7 @@ func TestReadFSMetadata(t *testing.T) {
|
||||
}
|
||||
|
||||
// Test with corrupted disk
|
||||
fsStorage := fs.storage.(*posix)
|
||||
fsStorage := fs.storage.(*retryStorage)
|
||||
naughty := newNaughtyDisk(fsStorage, nil, errFaultyDisk)
|
||||
fs.storage = naughty
|
||||
if _, err := readFSMetadata(fs.storage, ".minio.sys", fsPath); errorCause(err) != errFaultyDisk {
|
||||
@@ -111,7 +111,7 @@ func TestWriteFSMetadata(t *testing.T) {
|
||||
}
|
||||
|
||||
// Reading metadata with a corrupted disk
|
||||
fsStorage := fs.storage.(*posix)
|
||||
fsStorage := fs.storage.(*retryStorage)
|
||||
for i := 1; i <= 2; i++ {
|
||||
naughty := newNaughtyDisk(fsStorage, map[int]error{i: errFaultyDisk, i + 1: errFaultyDisk}, nil)
|
||||
fs.storage = naughty
|
||||
|
||||
Reference in New Issue
Block a user