mirror of
https://github.com/pgsty/minio.git
synced 2026-08-11 00:33:28 +03:00
xl: Make locking more granular for PutObjectPart requests (#2168)
This commit is contained in:
committed by
Harshavardhana
parent
ede4dd0f9c
commit
bef72f26db
@@ -261,16 +261,16 @@ func (xl xlObjects) statPart(bucket, object, uploadID, partName string) (fileInf
|
||||
return FileInfo{}, err
|
||||
}
|
||||
|
||||
// commitXLMetadata - commit `xl.json` from source prefix to destination prefix.
|
||||
func (xl xlObjects) commitXLMetadata(srcPrefix, dstPrefix string) error {
|
||||
// commitXLMetadata - commit `xl.json` from source prefix to destination prefix in the given slice of disks.
|
||||
func commitXLMetadata(disks []StorageAPI, srcPrefix, dstPrefix string, writeQuorum int) error {
|
||||
var wg = &sync.WaitGroup{}
|
||||
var mErrs = make([]error, len(xl.storageDisks))
|
||||
var mErrs = make([]error, len(disks))
|
||||
|
||||
srcJSONFile := path.Join(srcPrefix, xlMetaJSONFile)
|
||||
dstJSONFile := path.Join(dstPrefix, xlMetaJSONFile)
|
||||
|
||||
// Rename `xl.json` to all disks in parallel.
|
||||
for index, disk := range xl.storageDisks {
|
||||
for index, disk := range disks {
|
||||
if disk == nil {
|
||||
mErrs[index] = errDiskNotFound
|
||||
continue
|
||||
@@ -295,7 +295,7 @@ func (xl xlObjects) commitXLMetadata(srcPrefix, dstPrefix string) error {
|
||||
wg.Wait()
|
||||
|
||||
// Do we have write quorum?.
|
||||
if !isQuorum(mErrs, xl.writeQuorum) {
|
||||
if !isQuorum(mErrs, writeQuorum) {
|
||||
return errXLWriteQuorum
|
||||
}
|
||||
// For all other errors return.
|
||||
|
||||
Reference in New Issue
Block a user