From 0e7fdcee3037fc8acfdd66f856c24ed6a2a5e68f Mon Sep 17 00:00:00 2001 From: Klaus Post Date: Thu, 9 Sep 2021 08:55:43 -0700 Subject: [PATCH] Healing: Decide healing inlining based on metadata (#13178) Don't perform an independent evaluation of inlining, but mirror the decision made when uploading the object. Leads to some objects being inlined or not based on new metrics. Instead respect previous decision. --- cmd/erasure-healing.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/erasure-healing.go b/cmd/erasure-healing.go index 95a402f32..b85a20877 100644 --- a/cmd/erasure-healing.go +++ b/cmd/erasure-healing.go @@ -428,7 +428,7 @@ func (er erasureObjects) healObject(ctx context.Context, bucket string, object s } var inlineBuffers []*bytes.Buffer - if len(latestMeta.Parts) <= 1 && latestMeta.Size < smallFileThreshold { + if latestMeta.InlineData() { inlineBuffers = make([]*bytes.Buffer, len(outDatedDisks)) } @@ -479,7 +479,7 @@ func (er erasureObjects) healObject(ctx context.Context, bucket string, object s } partPath := pathJoin(tmpID, dstDataDir, fmt.Sprintf("part.%d", partNumber)) if len(inlineBuffers) > 0 { - inlineBuffers[i] = bytes.NewBuffer(make([]byte, 0, erasure.ShardFileSize(latestMeta.Size))) + inlineBuffers[i] = bytes.NewBuffer(make([]byte, 0, erasure.ShardFileSize(latestMeta.Size)+32)) writers[i] = newStreamingBitrotWriterBuffer(inlineBuffers[i], DefaultBitrotAlgorithm, erasure.ShardSize()) } else { writers[i] = newBitrotWriter(disk, minioMetaTmpBucket, partPath,