mirror of
https://github.com/minio/minio.git
synced 2025-02-03 01:46:00 -05:00
parent
247e835d7b
commit
658a595d7a
@ -640,6 +640,7 @@ func (xl XL) RenameFile(srcVolume, srcPath, dstVolume, dstPath string) error {
|
||||
nsMutex.Lock(dstVolume, dstPath)
|
||||
defer nsMutex.Unlock(dstVolume, dstPath)
|
||||
|
||||
errCount := 0
|
||||
for index, disk := range xl.storageDisks {
|
||||
// Make sure to rename all the files only, not directories.
|
||||
srcErasurePartPath := slashpath.Join(srcPath, fmt.Sprintf("file.%d", index))
|
||||
@ -652,6 +653,14 @@ func (xl XL) RenameFile(srcVolume, srcPath, dstVolume, dstPath string) error {
|
||||
"dstVolume": dstVolume,
|
||||
"dstPath": dstErasurePartPath,
|
||||
}).Errorf("RenameFile failed with %s", err)
|
||||
|
||||
errCount++
|
||||
// We can safely allow RenameFile errors up to len(xl.storageDisks) - xl.writeQuorum
|
||||
// otherwise return failure.
|
||||
if errCount <= len(xl.storageDisks)-xl.writeQuorum {
|
||||
continue
|
||||
}
|
||||
|
||||
return err
|
||||
}
|
||||
srcXLMetaPath := slashpath.Join(srcPath, xlMetaV1File)
|
||||
@ -664,6 +673,14 @@ func (xl XL) RenameFile(srcVolume, srcPath, dstVolume, dstPath string) error {
|
||||
"dstVolume": dstVolume,
|
||||
"dstPath": dstXLMetaPath,
|
||||
}).Errorf("RenameFile failed with %s", err)
|
||||
|
||||
errCount++
|
||||
// We can safely allow RenameFile errors up to len(xl.storageDisks) - xl.writeQuorum
|
||||
// otherwise return failure.
|
||||
if errCount <= len(xl.storageDisks)-xl.writeQuorum {
|
||||
continue
|
||||
}
|
||||
|
||||
return err
|
||||
}
|
||||
err = disk.DeleteFile(srcVolume, srcPath)
|
||||
@ -672,6 +689,14 @@ func (xl XL) RenameFile(srcVolume, srcPath, dstVolume, dstPath string) error {
|
||||
"srcVolume": srcVolume,
|
||||
"srcPath": srcPath,
|
||||
}).Errorf("DeleteFile failed with %s", err)
|
||||
|
||||
errCount++
|
||||
// We can safely allow RenameFile errors up to len(xl.storageDisks) - xl.writeQuorum
|
||||
// otherwise return failure.
|
||||
if errCount <= len(xl.storageDisks)-xl.writeQuorum {
|
||||
continue
|
||||
}
|
||||
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user