remove null version dataDir upon overwrites (#12023)

This commit is contained in:
Harshavardhana 2021-04-08 19:55:44 -07:00 committed by GitHub
parent 8f98e3acfa
commit 928ee1a7b2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2041,11 +2041,12 @@ func (s *xlStorage) RenameData(ctx context.Context, srcVolume, srcPath, dataDir,
return err
}
if oldDstDataPath != "" {
renameAll(oldDstDataPath, pathutil.Join(s.diskPath, minioMetaTmpDeletedBucket, mustGetUUID()))
}
// renameAll only for objects that have xl.meta not saved inline.
if len(fi.Data) == 0 && fi.Size > 0 {
if oldDstDataPath != "" {
renameAll(oldDstDataPath, pathutil.Join(s.diskPath, minioMetaTmpDeletedBucket, mustGetUUID()))
}
renameAll(dstDataPath, pathutil.Join(s.diskPath, minioMetaTmpDeletedBucket, mustGetUUID()))
if err = renameAll(srcDataPath, dstDataPath); err != nil {
logger.LogIf(ctx, err)