From 4e058c2bcef5488408888e4d60c4ac40758d464b Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Sat, 9 May 2026 14:45:08 -0700 Subject: [PATCH] refactor(ec): drop unused shardPaths slice in generateMissingEcFiles The slice was populated for present shards but never read. Drop it; ghost residue is already tracked separately and the input file handle is the only thing the rebuild loop consumes. --- weed/storage/erasure_coding/ec_encoder.go | 2 -- 1 file changed, 2 deletions(-) diff --git a/weed/storage/erasure_coding/ec_encoder.go b/weed/storage/erasure_coding/ec_encoder.go index db927197a..00ed827ae 100644 --- a/weed/storage/erasure_coding/ec_encoder.go +++ b/weed/storage/erasure_coding/ec_encoder.go @@ -160,7 +160,6 @@ func generateMissingEcFiles(baseFileName string, bufferSize int, largeBlockSize // Pass 1: discover which shards exist and which are missing, // opening input files but NOT creating output files yet. shardHasData := make([]bool, ctx.Total()) - shardPaths := make([]string, ctx.Total()) // non-empty for present shards inputFiles := make([]*os.File, ctx.Total()) var ghostPaths []string expectedShardSize := int64(-1) @@ -180,7 +179,6 @@ func generateMissingEcFiles(baseFileName string, bufferSize int, largeBlockSize shardPath, shardSize, expectedShardSize) } shardHasData[shardId] = true - shardPaths[shardId] = shardPath inputFiles[shardId], err = os.OpenFile(shardPath, os.O_RDONLY, 0) if err != nil { return nil, err