From 6a7e22386e5899e5f7211201f3a2bfea57fd06a4 Mon Sep 17 00:00:00 2001 From: Poorna Krishnamoorthy Date: Tue, 24 Aug 2021 17:41:05 -0400 Subject: [PATCH] Use part sizes correctly in multipart replication (#13061) fixes #13057 --- buildscripts/verify-healing.sh | 2 +- cmd/bucket-replication.go | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/buildscripts/verify-healing.sh b/buildscripts/verify-healing.sh index 77e14bd83..10ded055a 100755 --- a/buildscripts/verify-healing.sh +++ b/buildscripts/verify-healing.sh @@ -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 diff --git a/cmd/bucket-replication.go b/cmd/bucket-replication.go index b0c1dc818..7e6ccf000 100644 --- a/cmd/bucket-replication.go +++ b/cmd/bucket-replication.go @@ -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,