mirror of
https://github.com/pgsty/minio.git
synced 2026-08-11 08:43:28 +03:00
XL: PutObjectPart update checksum, re-read from xl.json for the part being written. (#2191)
This commit is contained in:
committed by
Harshavardhana
parent
0fcfb5df3b
commit
0610527868
+1
-16
@@ -444,28 +444,13 @@ func (xl xlObjects) PutObjectPart(bucket, object, uploadID string, partID int, s
|
||||
updatedEInfos = append(updatedEInfos, partsMetadata[index].Erasure)
|
||||
}
|
||||
|
||||
var checksums []checkSumInfo
|
||||
for index, eInfo := range newEInfos {
|
||||
if eInfo.IsValid() {
|
||||
// Use a map to find union of checksums of parts that
|
||||
// we concurrently written and committed before this
|
||||
// part. N B For a different, concurrent upload of the
|
||||
// same part, the last written content remains.
|
||||
checksumSet := make(map[string]checkSumInfo)
|
||||
checksums = newEInfos[index].Checksum
|
||||
for _, cksum := range checksums {
|
||||
checksumSet[cksum.Name] = cksum
|
||||
}
|
||||
checksums = updatedEInfos[index].Checksum
|
||||
for _, cksum := range checksums {
|
||||
checksumSet[cksum.Name] = cksum
|
||||
}
|
||||
// Form the checksumInfo to be committed in xl.json
|
||||
// from the map.
|
||||
var finalChecksums []checkSumInfo
|
||||
for _, cksum := range checksumSet {
|
||||
finalChecksums = append(finalChecksums, cksum)
|
||||
}
|
||||
finalChecksums := unionChecksumInfos(newEInfos[index].Checksum, updatedEInfos[index].Checksum, partSuffix)
|
||||
updatedEInfos[index] = eInfo
|
||||
updatedEInfos[index].Checksum = finalChecksums
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user