fix: remove parent dirs in RenameData upon failure (#12452)

- it is possible that during I/O failures we might
  leave partially written directories, make sure
  we purge them after.

- rename current data-dir (null) versionId only after
  the newer xl.meta has been written fully.

- attempt removal once for minioMetaTmpBucket/uuid/
  as this folder is empty if all previous operations
  were successful, this allows avoiding recursive os.Remove()
This commit is contained in:
Harshavardhana
2021-06-07 09:35:08 -07:00
committed by GitHub
parent 403f4b9c84
commit dd2831c1a0
3 changed files with 55 additions and 15 deletions

View File

@@ -356,10 +356,10 @@ func testStorageAPIDeleteFile(t *testing.T, storage StorageAPI) {
expectErr bool
}{
{"foo", "myobject", false},
// should removed by above case.
{"foo", "myobject", true},
// file not found error
{"foo", "yourobject", true},
// file not found not returned
{"foo", "myobject", false},
// file not found not returned
{"foo", "yourobject", false},
}
for i, testCase := range testCases {