Repository navigation
3.x.x: fail the database over, fill its WAL volume and restart over a candidate backlog under load, nightly and weekly on the real node (#554) - #635
Conversation
… candidate backlog under load, nightly and weekly on the real node (#554) The second half of #554's faults, in qbit-prism-load's `faults` phase. Each is injected while the sessions keep mining and held to its criteria on top of the run's own reconciliation. No server code changes. - primary-kill: a barrier shows the standby flushed the primary's position, replication is cut, the primary keeps acknowledging for `cut` s and is stopped immediately, and the async standby is promoted. Every acknowledged share the new primary lacks is listed; none may predate the barrier, and each must be absent from what the standby had received. - primary-switch: writers fenced, the standby replays through the old primary's flush position, then the switch. Nothing may be lost. - block-failover: the relay holds a found block's submitblock while replication is cut and the primary stopped. With #529's standby wait on, the reservation must be on the promoted primary, and the block must reach the node once and land within 30 s of the promotion (#585). - wal-disk-full: #575's DiskFullInjector fills the primary's pg_wal volume until PostgreSQL stops, then frees it. Nothing acknowledged may be lost or acknowledged while it is down. The frontends must serve again without a restart, and every /metrics must show #575's paging condition. - candidate-backlog: the relay answers submitblock with qbitd's warmup error (#526) while found blocks pile up, every frontend is restarted, the relay heals. Every backlog row must reach a terminal state, and none may reach the node twice. For these, the managed cluster streams its standby through a replication link the harness can cut. Every writer (the frontends and the harness's side pool) reaches the primary through a writer endpoint, and the public reader reaches the standby through a read endpoint. A promotion moves the endpoints and rebuilds the standby; nothing is restarted. The run excuses, from its durability finding, only the acknowledged shares a failover's verdict proves lie in the replication gap. faults-short-real-node (nightly) gains every new fault but the full WAL volume. faults-long-real-node (weekly, #588's Saturday selection, 16 vCPU) runs all twelve with 2,000 sessions. faults-failover-fake-node runs the five on dispatch. No per-PR test is added. Refs #554 Co-Authored-By: Claude Opus 5.5 <[email protected]>
…e WAL volume (#554) faults-long-real-node, on the Saturday `weekly` selection beside the soak, and faults-failover-fake-node, on dispatch, run #554's wal-disk-full fault. That fault mounts the primary's pg_wal on a small ext4 image with fuse2fs, without root, as #575's disk-full scenario does. The run job now installs fuse2fs and fuse3 when the preset's --faults lists wal-disk-full, and the header and the dispatch input name the new weekly preset and its cost. Refs #554 Co-Authored-By: Claude Opus 5.5 <[email protected]>
…and finish an abandoned failover (#554) Review of #635 (/code-review medium, a quality review and an adversarial review) found checks that could pass without proving their claim, a flake, and a cleanup gap. No server code changes. - candidate-backlog passed even if every backlog row was abandoned at the relaunch. It now requires one backlog block to land, offered once. - block-failover took its barrier before waiting up to 30 s for the found block, so that whole window counted as the replication gap. The barrier is now taken after the held call arrives, just before the cut. The held call goes to the node within 800 ms of arriving, inside the frontend's 1 s submitblock deadline, however long the stop takes. - wal-disk-full now starts its down intervals and its outcome-unknown window at the fill's start, so a PANIC during the fill is counted. An acknowledgement inside a down interval fails the check only when its share is absent from PostgreSQL, since a late answer to an earlier commit is not a lie. - An abandoned failover waits for its in-flight stop or promotion, promotes once, heals a cut link and moves the writer endpoint, so the run's end still finds a primary. - The gap key's constant is renamed to match its value; the frozen set's lookback is named and leaves re-offers out; a unit test pins the backlog's unfinished states to the server's CandidateState::UNFINISHED_SQL. Refs #554 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Handover@kiwidream now owns this PR. Head is 8af944e, the review fixes. CI is still running on the head commit. A review ledger will be posted here once CI is green. Any findings from that review will be listed in the ledger as open items with a proposed fix. No new commits will be pushed by the current owner. Left to do: green CI, the ledger, then owner review and merge. Its nightly and weekly workflow wiring takes effect only once main's workflow copy is synced (#633), which is blocked on #601. |
Review ledger: #635 (Refs #554)Lanes run
Every finding was checked against the code. The fixes after review are in one follow-up commit, 8af944e. Fixed before signing (in d1e3947)
Fixed after review (8af944e)
Deferred to #636Structural, with no behaviour change. #636 has the detail.
Rejected
Verification after the fixes (8af944e)
|
…ts on #621, not #604 Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
#551, #553, #554, #582) The file is 3.x.x's copy byte for byte again, as of 3.x.x c95febb; the last change to it there is bd1ddeb (#663). Since 1932cb3 (#597), five 3.x.x changes landed in it: - #552 (#613): the `bridging` job runs the short plan on the fake and the real node on one runner, nightly, on the run-load label and on a dispatch with the new `bridging` input. - #551 (#606): every preset job builds a trend row; on a schedule the `evidence` job (the one job with `contents: write`) appends the rows to the orphan `ci-evidence` branch, applies the report-only regression rule, promotes the soak's and flagged runs' bundles to the rolling `ci-evidence/YYYY-MM` pre-release, and keeps one `prism-load-regression` issue. PR and dispatch runs get the read-only `evidence-preview` instead. - #553 (#618): the live nightly and weekly lists gain the chain-event scenarios under 2,000 sessions; the workflow's comments say so. - #554 (#635): the run job installs fuse2fs and fuse3 for a preset whose faults fill the WAL volume (faults-long-real-node, Saturday). - #582 (#663): comment only. Without this, main's scheduled copy (#595) still has no qbitd install step, so every `--node qbitd` preset fails with "--node qbitd needs --qbitd-bin or QBITD_BIN" (scheduled runs 37188928798 and 37287515779). Co-Authored-By: Claude Opus 5.5 <[email protected]>
(#590, #596, #588, #597, #552, #551, #553, #554) (#601) * main: sync the PRISM load-harness nightly workflow from 3.x.x (#590, #596) Co-Authored-By: Claude Opus 5.5 <[email protected]> * main: sync the PRISM load-harness nightly workflow from 3.x.x (#590, #596, #588, #597) Adds #588's Saturday 5.5 h soak schedule and its live-nightly step that runs every listed test binary, so qbit-prism-load::soak_smoke runs beside the live_regtest variants, and #597's L6 shipped-images lane on the Sunday schedule. Byte-identical to 3.x.x at 1932cb3. Co-Authored-By: Claude Opus 5.5 <[email protected]> * main: re-sync the PRISM load-harness nightly workflow from 3.x.x (#552, #551, #553, #554, #582) The file is 3.x.x's copy byte for byte again, as of 3.x.x c95febb; the last change to it there is bd1ddeb (#663). Since 1932cb3 (#597), five 3.x.x changes landed in it: - #552 (#613): the `bridging` job runs the short plan on the fake and the real node on one runner, nightly, on the run-load label and on a dispatch with the new `bridging` input. - #551 (#606): every preset job builds a trend row; on a schedule the `evidence` job (the one job with `contents: write`) appends the rows to the orphan `ci-evidence` branch, applies the report-only regression rule, promotes the soak's and flagged runs' bundles to the rolling `ci-evidence/YYYY-MM` pre-release, and keeps one `prism-load-regression` issue. PR and dispatch runs get the read-only `evidence-preview` instead. - #553 (#618): the live nightly and weekly lists gain the chain-event scenarios under 2,000 sessions; the workflow's comments say so. - #554 (#635): the run job installs fuse2fs and fuse3 for a preset whose faults fill the WAL volume (faults-long-real-node, Saturday). - #582 (#663): comment only. Without this, main's scheduled copy (#595) still has no qbitd install step, so every `--node qbitd` preset fails with "--node qbitd needs --qbitd-bin or QBITD_BIN" (scheduled runs 37188928798 and 37287515779). Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Co-authored-by: Claude Opus 5.5 <[email protected]> Co-authored-by: Robert Clarke <[email protected]>
Refs #554 (#487 S16). This is the second of #554's two PRs: the faults #623 left open, as agreed in the design on #554. They are the primary lost with its async standby promoted (and the fenced switch), a found block mid-landing across a failover, a full WAL volume, and a restart over a candidate backlog. Each runs under load in
qbit-prism-load'sfaultsphase and is held to its criteria. No server code changes, and no server defect was found.What
Five new faults in
src/fault/. Each is injected while the sessions keep mining. Its criteria come on top of the run's own contract: every acknowledged share in PostgreSQL, no committed share unanswered mid-run, and onesubmitblockper block hash.primary-killcuts. The primary is stopped immediately, the async standby promoted, the writer endpoint moved to it, and a new standby built.primary-switchblock-failoversubmitblock. As the call arrives, replication is cut and the primary stopped. The call then goes on to the node, and the standby is promoted.PRISM_OFFER_STANDBY_APPLICATION_NAME. The block reaches the node once and lands within 30 s of the promotion, with outcomeunknownoraccepted(#585). Blocks the relay forwarded around the failover are listed with their rows, so a gap-lost candidate is counted. Losses are checked as forprimary-kill.wal-disk-fullpg_walsits on a 1 GiB fuse2fs volume, #575'sDiskFullInjector(included by#[path]). It uses 1 MiB segments withwal_recycle=off. The volume is filled and segment switches forced until PostgreSQL PANICs. PostgreSQL's crash recovery can find room again, because it deletes the segments it no longer needs; forholds the volume is refilled whenever PostgreSQL accepts connections. The volume is then freed, and PostgreSQL started again if its postmaster exited./metricsshowed #575's paging condition,qbit_prism_collector_available{collector="database"} == 0. If PostgreSQL cannot be brought back, the run fails with the primary's log rather than hanging.candidate-backlogsubmitblockwith qbitd's warmup error (−28). The server knows that call was never run (#526), so each row goes back topending. It holds the answer untilbacklogfound blocks are unfinished, then both frontends get SIGTERM and are relaunched while it still refuses. The relay then heals.How the database is failed over. A plan with a failover asks the managed cluster for three things:
The promotion follows the operator procedure: the primary goes,
pg_ctl promotewaits, and only then do the endpoints move. Nothing is restarted, and every client reconnects to the same address. A new standby is then built from the new primary (pg_basebackupwith a new slot), so later faults and the run's replication premise still have one. Only a run with such a fault gets this topology; every other run's cluster is unchanged.What the run excuses. The run's durability finding (exit 4) excuses only the acknowledged shares a failover's verdict proves are in the replication gap: each was acknowledged after the barrier and was absent from the standby at promotion. Commits the server answered
ledger-outcome-unknownwhile the primary was going are excused too. Each is listed in the fault's row. Any other missing share is still exit 4. The gate's reconciliation row now counts the gap separately, as "0 (and N in a failover's replication gap, each listed in its fault row)".Three behaviours by design, handled in the harness rather than reported as defects:
wal-disk-fulland failover windows out until the first 2xx, and each of those faults requires that 2xx within 30 s of its removal.inconclusive. It stays inreconciliationuntil the winner hasPRISM_CANDIDATE_ORPHAN_CONFIRMATIONS(6) confirmations (3.x.x: lost-race regression test and a terminal orphan disposition for reconciliation rows #415). The fault mints those six blocks, and the row then settles asorphaned.wal_recycle=off, crash recovery deletes the segments it no longer needs, finds room and comes back. The fault refills the volume each time, and takes when PostgreSQL was down from its own log rather than from a probe.#529's standby wait (
PRISM_OFFER_STANDBY_APPLICATION_NAME) is set for the whole of a run that lists a failover, as a pool with a failover standby runs. Every found block's offer infaults-short-real-nodetherefore waits up to 250 ms for the standby's flush first. That is a change from earlier nights' landing timings.Where it runs, and what it costs
faults-short-real-nodecandidate-backlog,primary-kill,primary-switchandblock-failover(11 faults).faults-long-real-node(new)weeklyselection, its own runner beside the soakwal-disk-fullfirst, with 2,000 sessions at 200 shares/s after a 45-minute warm-up with six external tips. The faults themselves take about 11 minutes.faults-failover-fake-node(new)The workflow change is a separate commit. The run job installs
fuse2fsandfuse3only for a preset whose--faultslistswal-disk-full.Tests and mutants
Checks run on the final tree:
cargo fmt --checkandcargo clippy -p qbit-prism-load --all-targets -D warnings.qbit-prism-load's lib (42 tests),harness(139),churn,soak_planandrealism.harness,classify_gapsexcusing only what a fault proves.faults(33 s),load_smoke,real_nodeandquorum_replicationtests, on PostgreSQL 16 with fsync on andPRISM_TEST_REQUIRE_INTEGRATION=1.check_e2e_scenarios.py,actionlint, and the Python unittest suite. 853 tests pass; the 6 image-smoke tests fail here for want of a native server binary, which this change does not touch.Runs:
faults-failover-fake-nodeon a debug build: exit 0, all five faults passing.faults-short-real-node, run the way the nightly runs it (prism-load-run.sh, release builds, real node, a shared host): gate PASS and exit 0 in 678 s, all eleven faults passing.primary-killlost 151 of 632 acknowledged shares in its 3 s cut, each listed, all after the barrier. The gate reads "0 (and 152 in a failover's replication gap…)", the extra one fromblock-failover.primary-switchlost 0 of 501; the standby was 120 bytes ahead after the fast stop's shutdown checkpoint.block-failoverlanded 2.4 s after the promotion, outcomeunknown, forwarded once.faults-long-real-nodewith its warm-up cut to 4 minutes (release, real node, 2,000 sessions at 200 shares/s): exit 0, all twelve faults passing.wal-disk-fullrefilled twice; PostgreSQL's log showed it down for 28.7 s, with 0 acknowledgements inside.primary-killlost 1,001 of 3,002 acknowledged shares in its 5 s cut, each listed, all after the barrier.primary-switchlost 0 of 2,000.block-failoverlanded 2.3 s after the promotion.Mutants. Each was applied to the server, built, run against a one-fault copy of
faults-failover-fake-node, and reverted.synchronous_commit = off(an ACK before its WAL is flushed)primary-killwal-disk-fullblock-failoveroffer_reservedfor the 90 s watch, waiting for the 120 s lease.pendingbut never retriedcandidate-backlogpending.Not covered here
wal-disk-fullruns weekly only, because it puts the primary's WAL on fuse2fs for the whole run. It must run before any failover in a plan, and the plan parser refuses otherwise.frontend-sigkill, 3.x.x: PostgreSQL failover findings — async gap can lose found blocks; lease delays mid-landing recovery; recovered outcome unrecorded #529 option A). That is unchanged from 3.x.x: inject faults under load in a load-harness fault phase, per PR and nightly on the real node (#554) #623.🤖 Generated with Claude Code
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.