Repository navigation
[BUG](log): Revalidate compaction backpressure - #7914
Draft
lyon-chroma wants to merge 1 commit into
Draft
lyon-chroma wants to merge 1 commit into
lyon-chroma wants to merge 1 commit into
Conversation
Reviewer ChecklistPlease leverage this checklist to ensure your code review is thorough before approving Testing, Bugs, Errors, Logs, Documentation
System Compatibility
Quality
|
This branch has not been deployed
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.
A collection can keep moving through compaction while a former log host reports millions of operations as pending. The host caches the committed compaction position, so an obsolete value can inflate backlog metrics and cause writes to be rejected. This draft refreshes those positions sooner and verifies durable progress before enforcing compaction backpressure.
The incident evidence and recommended recovery checks are in the central investigation. In incident 25272, xAI collection
60f88932-e829-4c3e-8f97-7ff7355474b8has a committed position above 70.3 million while two hosts report positions of 41.6 million and 51.5 million. Compaction continues without worker restarts. The apparent backlog clears near the 180-reinsertion refresh boundary. Customer write rejections from that incident remain unconfirmed.The log service now refreshes cached positions every six dirty-log summarization passes by default, approximately one minute at the default interval. It also refreshes immediately when a summary reaches the write-backpressure threshold. This cadence is independent of the waiting period that allows small writes to form compaction batches. The new setting is
compaction_cursor_refresh_interval_rollups; zero or one refreshes every pass.Before rejecting a write whose object-storage summary reports a full log, the service reads the durable compaction cursor and checks the current summaries again. Requests for the same collection share the existing collection lock and can reuse a verified cursor for at most one second. Replicated-log pressure remains authoritative. A missing cursor preserves the pending range; an unreadable or corrupt cursor returns an unavailable error without admitting the write. Explicit cursor updates and cache purges invalidate the short verification cache. Fresh verification logs the collection, reported position, pending limit, durable position, and resulting decision.
Validation: six focused tests pass using local cursor files. They cover early refresh for pressured summaries, periodic refresh below the batch threshold, admission after another host commits progress, continued rejection when the pending range grows, missing cursors, replicated-log pressure, expiry of verification, and corrupt durable cursors. The existing cluster-backed reinsertion-eviction test remains for CI and is not run locally because its services are unavailable. Formatting, whitespace checks, and Clippy with warnings treated as errors pass for the library and test targets.
The tradeoff is additional cursor reads during summarization and on the first pressured request after verification expires. Summarization reads use the existing concurrency limit. The verification cache reduces repeated reads under concurrent pressure, but storage latency remains on this exceptional request path. The larger paging threshold in Terraform PR 8468 is separate mitigation and does not change the per-collection backpressure threshold.
Human release and verification TODOs: