Files
seaweedfs/weed/replication/sink
1f8ad7016f filer: compare garbage chunks by needle identity (#12992)
* Normalize chunk identities during garbage comparison

* Keep replication chunk respellings observable

* filer: skip the needle identity index when nothing is subtracted

Every compaction subtracted its retained chunks from an often empty
covered list, parsing and re-formatting each retained file ID first.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* filer: skip the identity subtraction at the compaction call site

Returning early from doMinusChunks on an empty minuend stopped
MinusChunks from calling GetFileIdString on the new entry's chunks.
After CreateEntry of a new file, the caller's chunks then kept the
FileId that BeforeEntrySerialization cleared, so tus completion built
its still-referenced set from empty IDs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* filer: match needle spellings through DoMinusChunks instead of a new function

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* filer: DoMinusChunks always matches chunks by needle

Drop the byNeedle parameter so DoMinusChunks keeps its two-argument
signature and every caller, including ones added on master since,
compares equivalent file ID spellings as the same needle. The needle
normalization moves from the server scope checks to filer.ChunkIdentity
so both share it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* filersink: match replicated source file IDs by needle

compareChunks no longer reports a respelled source chunk, so the
replica keeps the SourceFileId it was copied under. Removing chunks the
source dropped and judging stale backup chunks now compare that ID by
needle, otherwise a later removal in the other spelling would leave the
replica's chunk behind.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Chris Lu <chrislusf@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-26 17:25:55 -08:00
..