Skip to content

fix(storage): publish immutable windows with durable lineage - #654

Merged
zzylol merged 12 commits into
mainfrom
feat/immutable-output-publication
Sep 11, 2026
Merged

zzylol merged 12 commits into
mainfrom
feat/immutable-output-publication

Conversation

@zzylol

@zzylol zzylol commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

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 FlusherShared handle. 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.

@zzylol
zzylol marked this pull request as ready for review September 11, 2026 15:22
@zzylol
zzylol changed the base branch from feat/maintenance-input-identity to main September 11, 2026 15:37
@zzylol
zzylol merged commit eaad528 into main Sep 11, 2026
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant