Skip to content

Make completed summary windows immutable after durable flush - #644

Merged
zzylol merged 7 commits into
mainfrom
feat/maintenance-completion
Sep 11, 2026
Merged

zzylol merged 7 commits into
mainfrom
feat/maintenance-completion

Conversation

@zzylol

@zzylol zzylol commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Completed inner windows must remain unchanged before maintenance can safely feed them into an outer sketch. Closing the Remote Write receiver did not prevent other producers from changing the same stored window, and a persisted completion marker without durable payload would prevent repair after restart.

This change enforces a per-physical-SeriesId completed-window boundary in SummaryStore. Completion holds the append fence, verifies admitted work is published, requests the existing flusher to persist the completed prefix, and only then writes the monotone boundary to the existing metadata sidecar. Future windows remain writable. Remote Write drain waits for this durability barrier; OTLP and precompute publication propagate rejected late writes.

Before this PR: a window could be called complete, then changed by a late sketch or exact-state append; restarting did not preserve a write-admission boundary.

After this PR: a completed [0,30000) window rejects late writes both before and after restart, while [30000,60000) can still accept state. Stale metadata flushes cannot reopen it. Failed completion persistence leaves the live revision and boundary unchanged.

Verification: 303 storage tests passed after integration with current main and #645, including real payload/manifest flush with no ordinary hot-tier deadline, shutdown/restart, late sketch/exact rejection, failed metadata persistence, stale metadata flush, and future-window isolation. All nine real production-process compatibility tests passed (22.77s), including persisted-state restart and Remote Write execution. Performance measurements are not applicable.

This is the immutable input boundary for maintenance, not a complete summary-over-summary executor. Durable atomic publication of derived outputs, continuous producer watermarks, and physical-lifetime metadata reclamation remain follow-ups. In-memory deployments have no restart guarantee. Includes independently reviewed #645; merge that dependency first.

@zzylol
zzylol marked this pull request as ready for review September 11, 2026 13:22
@zzylol
zzylol merged commit c1121c6 into main Sep 11, 2026
1 check 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