diff --git a/weed/storage/erasure_coding/ec_decoder.go b/weed/storage/erasure_coding/ec_decoder.go index bdcbc5084..abba2526b 100644 --- a/weed/storage/erasure_coding/ec_decoder.go +++ b/weed/storage/erasure_coding/ec_decoder.go @@ -215,6 +215,7 @@ func min(x, y int64) int64 { // WriteDatFileAndVacuum reconstructs volume from EC shards and then vacuums deleted needles // This reuses existing WriteDatFile and volume compaction logic to achieve the same result more cleanly +// Creates cleaned volume files (without generation) that are ready for generational EC encoding func WriteDatFileAndVacuum(baseFileName string, shardFileNames []string) error { // Step 1: Use existing WriteDatFile to reconstruct the full volume datFileSize, err := FindDatFileSize(baseFileName, baseFileName) @@ -243,9 +244,11 @@ func WriteDatFileAndVacuum(baseFileName string, shardFileNames []string) error { return fmt.Errorf("failed to read volume version: %w", err) } + // Create cleaned volume files (without generation suffix) + // These will later be copied to generation-aware names by encodeVolumeToEcShards() return copyDataBasedOnIndexFileForEcVacuum( tempDatFile, tempIdxFile, // source files (with deleted entries) - baseFileName+".dat", baseFileName+".idx", // destination files (cleaned) + baseFileName+".dat", baseFileName+".idx", // destination files (cleaned, ready for generational encoding) version, ) } diff --git a/weed/worker/tasks/ec_vacuum/ec_vacuum_task.go b/weed/worker/tasks/ec_vacuum/ec_vacuum_task.go index 2356e0d10..f4330a6aa 100644 --- a/weed/worker/tasks/ec_vacuum/ec_vacuum_task.go +++ b/weed/worker/tasks/ec_vacuum/ec_vacuum_task.go @@ -403,12 +403,13 @@ func (t *EcVacuumTask) decodeEcShardsToVolume() error { return fmt.Errorf("failed to reconstruct and vacuum volume: %w", err) } - t.LogInfo("Successfully decoded EC shards to filtered normal volume", map[string]interface{}{ + t.LogInfo("Successfully decoded EC shards to cleaned volume", map[string]interface{}{ "dat_file": datFileName, "idx_file": idxFileName, "original_dat_size": datFileSize, "deleted_entries_filtered": true, - "note": "deleted needles physically removed from volume", + "note": "cleaned volume ready for generational EC encoding", + "next_step": "will create generation-aware EC shards", }) return nil