Use part sizes correctly in multipart replication (#13061)

fixes #13057
This commit is contained in:
Poorna Krishnamoorthy 2021-08-24 17:41:05 -04:00 committed by GitHub
parent 85dfb4351c
commit 6a7e22386e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 5 deletions

View File

@ -93,7 +93,7 @@ function perform_test() {
rm -rf ${WORK_DIR}/${1}/*/
start_minio_3_node 60
start_minio_3_node 120
rv=$(check_online)
if [ "$rv" == "1" ]; then

View File

@ -950,16 +950,16 @@ func replicateObjectWithMultipart(ctx context.Context, c *miniogo.Core, bucket,
)
for _, partInfo := range objInfo.Parts {
hr, err = hash.NewReader(r, partInfo.Size, "", "", partInfo.Size)
hr, err = hash.NewReader(r, partInfo.ActualSize, "", "", partInfo.ActualSize)
if err != nil {
return err
}
pInfo, err = c.PutObjectPart(ctx, bucket, object, uploadID, partInfo.Number, hr, partInfo.Size, "", "", opts.ServerSideEncryption)
pInfo, err = c.PutObjectPart(ctx, bucket, object, uploadID, partInfo.Number, hr, partInfo.ActualSize, "", "", opts.ServerSideEncryption)
if err != nil {
return err
}
if pInfo.Size != partInfo.Size {
return fmt.Errorf("Part size mismatch: got %d, want %d", pInfo.Size, partInfo.Size)
if pInfo.Size != partInfo.ActualSize {
return fmt.Errorf("Part size mismatch: got %d, want %d", pInfo.Size, partInfo.ActualSize)
}
uploadedParts = append(uploadedParts, miniogo.CompletePart{
PartNumber: pInfo.PartNumber,