From 85620dfe93f8d5db87a2a1d2fb8d1a5b988a5502 Mon Sep 17 00:00:00 2001 From: Klaus Post Date: Thu, 25 Feb 2021 10:11:31 -0800 Subject: [PATCH] use bucket in path in distribution hash (#11634) Use bucket in erasure distribution hash. For the rare cases where objects with the same names are uploaded to many buckets. --- cmd/erasure-multipart.go | 2 +- cmd/erasure-object.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/erasure-multipart.go b/cmd/erasure-multipart.go index c260e0633..15cedd1a2 100644 --- a/cmd/erasure-multipart.go +++ b/cmd/erasure-multipart.go @@ -283,7 +283,7 @@ func (er erasureObjects) newMultipartUpload(ctx context.Context, bucket string, } dataBlocks := len(onlineDisks) - parityBlocks - fi := newFileInfo(object, dataBlocks, parityBlocks) + fi := newFileInfo(pathJoin(bucket, object), dataBlocks, parityBlocks) // we now know the number of blocks this object needs for data and parity. // establish the writeQuorum using this data diff --git a/cmd/erasure-object.go b/cmd/erasure-object.go index 6ef0d8264..16e7f89a5 100644 --- a/cmd/erasure-object.go +++ b/cmd/erasure-object.go @@ -654,7 +654,7 @@ func (er erasureObjects) putObject(ctx context.Context, bucket string, object st // Initialize parts metadata partsMetadata := make([]FileInfo, len(storageDisks)) - fi := newFileInfo(object, dataDrives, parityDrives) + fi := newFileInfo(pathJoin(bucket, object), dataDrives, parityDrives) if opts.Versioned { fi.VersionID = opts.VersionID