Ignored errors in cleanup in commitXLMetadata (#2044)

Deletion of tmp files where xl metadata was saved before the commit
operation doesn't change the error returned to the caller. So, it is to
be ignored.
This commit is contained in:
Krishnan Parthasarathi 2016-06-30 16:37:51 -07:00 committed by Harshavardhana
parent 64899e5197
commit 285a94d2c0

View File

@ -279,18 +279,15 @@ func (xl xlObjects) commitXLMetadata(srcPrefix, dstPrefix string) error {
// Rename `xl.json` in a routine.
go func(index int, disk StorageAPI) {
defer wg.Done()
// Delete any dangling directories.
defer disk.DeleteFile(minioMetaBucket, srcPrefix)
// Renames `xl.json` from source prefix to destination prefix.
rErr := disk.RenameFile(minioMetaBucket, srcJSONFile, minioMetaBucket, dstJSONFile)
if rErr != nil {
mErrs[index] = rErr
return
}
// Delete any dangling directories.
dErr := disk.DeleteFile(minioMetaBucket, srcPrefix)
if dErr != nil {
mErrs[index] = dErr
return
}
mErrs[index] = nil
}(index, disk)
}