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.
master
Krishnan Parthasarathi 9 years ago committed by Harshavardhana
parent 64899e5197
commit 285a94d2c0
  1. 9
      xl-v1-multipart-common.go

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

Loading…
Cancel
Save