fix(storage): publish immutable windows with durable lineage - #654
Merged
Merged
Conversation
zzylol
marked this pull request as ready for review
September 11, 2026 15:22
zzylol
changed the base branch from
feat/maintenance-input-identity
to
main
September 11, 2026 15:37
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
An immutable maintenance output must not be merged twice when a process fails between writing its state and acknowledging publication. This adds a persistence primitive for one finalized window per physical SeriesId, reusing the existing parts, Manifest, SID sidecar, and flusher allocator.
Before, the regular epoch flusher had no durable input-lineage reservation for such outputs. After this change, publication reserves a part ID and input/payload digests in the SID sidecar, writes and validates that part, publishes its manifest entry, then advances completion. Restart can finish an already durable reserved part without reconstructing the input. Matching recovery validates lineage atomically, and committed lookup avoids rebuilding randomized sketches. One pending reservation and one latest completed receipt are retained per SeriesId; a different lineage cannot reuse an identical output as its acknowledgment.
Recovery and retention preserve pending parts. Critical metadata reads fail closed, stale ordinary-flusher upserts preserve reservations, and immutable publication shares the existing
FlusherSharedhandle. Payload hashing streams borrowed bytes rather than copying the serialized state.Verification: 96 shared contract tests and the real legacy derived-input rejection test passed on the combined latest-main stack. All 310 SketchStore tests passed in the dependent consumer branch, including the seven immutable-publication regressions for concurrent retries, failed manifest publication, changed lineage, committed lookup, atomic matching recovery, and restart. Independent source review passed; repository CI is pending. No performance or automatic maintenance execution claim is made.
Limitations: the store's maintenance consumer is a separate dependent change. A missing reserved part requires retained source input; a damaged partial part fails closed. Only the latest completed receipt can acknowledge retries, and expired payloads cannot be acknowledged. Historical SeriesId metadata GC and downgrade compatibility with binaries that ignore reservation metadata are not provided.