Skip to content

Commit

Permalink
Healing: Decide healing inlining based on metadata (minio#13178)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
klauspost authored Sep 9, 2021
1 parent 418f8be commit 0e7fdce
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cmd/erasure-healing.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
}

Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 0e7fdce

Please sign in to comment.