Repository navigation
Conversation
…elty waits for a build A transaction that changed nothing on a ledger created with no commit was poisoned as WorkerPanic: the worker completes a no-op by republishing the branch head, and such a branch has none. It now completes through Command::CompleteNoOp, which pops the entry and records the no-op receipt at t 0 (the receipt the same transaction gets outside a cluster), leaving the branch without a head. A follower's worker ferries it to the leader over a route of its own, apply_queue_no_op: a leader from before it answers 404 and the entry waits, where an ApplyHead would give the branch a head. A worker that found novelty full retried three times over 300 ms and then poisoned the entry, recording a failure under its key that no retry could clear once novelty drained. It now waits at the queue front and re-stages once an index build makes room, as it does for a lagging view. A transaction whose own novelty reaches the ceiling is poisoned with PoisonReason::NoveltyDeltaTooLarge and answered 413 + err:db/NoveltyDeltaTooLarge, as outside a cluster, instead of 422. The local and worker paths share one rule for telling the two apart. Both variants are appended, so this release reads older logs and snapshots; an older node cannot read the new entries. The v4 fixtures now also complete a no-op on the ledger v4 created with no commit.
…one waits out a mixed-version leader
Under a leader of an earlier release, an upgraded follower cannot resolve a ledger from before name bindings: only a leader of this release binds it. A write whose branch that follower owned failed to load the ledger, and its failure was recorded under the request's key, so a retry kept failing after the upgrade finished. The worker now waits at the queue front, as for full novelty, when the replicated state lists the branch with no binding, no fence and no drop, under a name the binding accepts. The docs say the follower answers 404 to queries for those ledgers until then.
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.
Stacked on #2485, whose v4 fixtures this change is checked against.
A no-op on a ledger with no commit (#2465)
On a cluster, a transaction that changes nothing completes its queue entry by republishing the branch's head. A ledger created with no commit has no head, so the entry was poisoned as
WorkerPanic. A standalone server answers the same transaction with a receipt att0.The worker now completes it with a new command,
CompleteNoOp. The command pops the entry, records the no-op receipt (CommitReceipt::no_op,t0, no flakes) under its idempotency key, and leaves the branch with no head. If the branch has gained a head since the worker staged, the entry goes back to the front and is staged again, as for any lagging view.A follower's worker sends the completion to the leader over a new route,
POST /raft/apply_queue_no_op, rather than throughapply_staged_commit. A leader from before this change would turn a staged commit into anApplyHead, which would give the branch the sentinel id as its head. A route that leader lacks answers 404 instead, and the worker retries until the leader is upgraded.Novelty backpressure on a cluster (#1741)
A worker that found novelty full treated it as transient: three attempts over 300 ms, then the entry was poisoned. It answered 422, and a failure was recorded under the key that no retry could clear once novelty drained. A delta too large for novelty answered 422
BodyMalformed.NoveltyAtMax, orNoveltyWouldExceedwith room once novelty drains): the entry waits at the front of its queue with backoff, up to 2 s per wait. It refreshes its view and re-stages once a build drains novelty, the way it already waits on a lagging view. No write guard is held while it waits. The client stays parked under the existing 10-minute ceiling, and a full queue turns new submissions away with 503.PoisonReason::NoveltyDeltaTooLargeand answered 413 +err:db/NoveltyDeltaTooLarge, as on a standalone server.The local path and the worker now share one rule (
novelty_refusal) for telling the two apart.A write on a ledger from 4.2 during the upgrade
A three-node run of this branch, upgrading a 4.2.9 cluster follower by follower as documented, found a failure that
nextalready had. Under the 4.2 leader, an upgraded follower cannot resolve the ledgers 4.2 created, because only a leader of this release binds them to their names. A write whose branch that follower owned failed to load its ledger and was poisoned asStagingFailed(422). The failure was recorded under the request's key, so a retry still failed after the upgrade finished.The worker now waits at the front of the queue, as for full novelty, when the replicated state lists the branch with no binding, no fence and no drop, under a name the binding accepts. The first leader of this release binds the ledger, and the write commits. A ledger it cannot load for any other reason still fails as before.
Replicated format
Command::CompleteNoOpandPoisonReason::NoveltyDeltaTooLargeare appended variants, pinned at positions 36 and 6 by a test. This release reads older logs and snapshots, but an older node cannot read the new entries. The rolling-upgrade docs say so, beside the name bindings that already need the upgrade finished. The v4 fixtures from #2485 still decode, still answer v4's cachedWorkerPanic, and now also complete a new no-op on the ledger v4 created with no commit.Tests
t0, again on a keyed retry, and the first write afterwards lands att1.NoveltyDeltaTooLarge.WorkerPanic,StagingFailed { attempts: 3 }(422) andBodyMalformed(422).Docs
raft-clusters.md: the submission flow covers no-op completion, novelty waits, and retrying by key after a 502 when the leader restarts. The rolling-upgrade section covers the new route, the 413 an older leader cannot decode, and what an upgraded follower does before the ledgers are bound.upgrading-from-4.2.md: until the first upgraded leader binds the ledgers, an upgraded follower answers 404 to queries for them and holds their writes.configuration.md: the--reindex-max-bytesdescription covers cluster behavior and the 413.raft-command-queue.md: listsCompleteNoOp.Fixes #2465
Fixes #1741