mirror of
https://github.com/minio/minio.git
synced 2025-01-23 20:53:18 -05:00
Rename back multipart objects if read/write Quorum was unavailable (#1773)
This commit is contained in:
parent
51bb613fdf
commit
5f679d9d1e
@ -180,7 +180,19 @@ func (xl xlObjects) renameObject(srcBucket, srcObject, dstBucket, dstObject stri
|
||||
if errCount <= len(xl.storageDisks)-xl.readQuorum {
|
||||
return nil
|
||||
}
|
||||
xl.deleteObject(srcBucket, srcObject)
|
||||
// Rename back the object on disks where RenameFile succeeded
|
||||
for index, disk := range xl.storageDisks {
|
||||
// Rename back the object in parallel to reduce overall disk latency
|
||||
wg.Add(1)
|
||||
go func(index int, disk StorageAPI) {
|
||||
defer wg.Done()
|
||||
if errs[index] != nil {
|
||||
return
|
||||
}
|
||||
_ = disk.RenameFile(dstBucket, retainSlash(dstObject), srcBucket, retainSlash(srcObject))
|
||||
}(index, disk)
|
||||
}
|
||||
wg.Wait()
|
||||
return errWriteQuorum
|
||||
}
|
||||
return nil
|
||||
|
Loading…
x
Reference in New Issue
Block a user