Repository navigation
3.x.x: inject faults under load in a load-harness fault phase, per PR and nightly on the real node (#554) - #623
Merged
Merged
Conversation
… and nightly on the real node (#554) --faults adds a `faults` side phase to qbit-prism-load in which each named fault is injected while the sessions keep mining, then held to its #554 pass criteria on top of the run's own reconciliation. A fault that misses one exits 9, and the gate shows one row per fault. No server code changes. The faults: a slow database through the delay proxy, PostgreSQL at max_connections with the frontends' idle backends terminated, a long SETTLEMENT_LOCK holder with a tip minted during the hold, SIGKILL of the frontend holding a block the node accepted, SIGTERM of a frontend with a found block's offer in flight, a rolling restart of both frontends, and a reconnect storm. A public-api process on the standby and every frontend's /metrics are scraped throughout. A per-frontend JSON-RPC relay, used only when a fault phase is asked for, holds or withholds a scheduled block's submitblock so the offer is in flight at a known moment. faults-pr-smoke runs the SIGTERM drain and the settlement-lock holder per PR on the fake node (tests/faults.rs, gated). faults-short-real-node runs all seven nightly on the real node with 500 sessions. The plan can be randomised and seeded for #556's soak. Every preset pins --faults, the manifest names each fault with its criteria, and check_e2e_scenarios.py knows the faults test binary. Refs #554 Co-Authored-By: Claude Opus 5.5 <[email protected]>
…checks that could pass without testing anything (#554) Review of the fault phase found checks that could pass without testing what they name, plus cleanup and timing gaps. No server code changes. Checks that could pass without testing anything: - settlement-lock on the real node took the first tip change after the mint request as the fault's tip, so a keepalive or found block could stand in for it. It now uses the fault's own mint as the pool node saw it. A tip that reached the pool node only after the release fails "the tip's jobs waited for the release" instead of passing on zero sessions. - "no share waited on the lock holder" now covers the whole hold, not only the time up to the mint. A refresh that queued for the holder while holding ORDER_LOCK would stall shares only after the mint. - frontend-sigkill waited up to 20 s for outstanding shares before the kill. By then the frontend's 1 s submitblock deadline could have recorded the call as unknown, so its answer was no longer what the kill lost. The kill now comes at once. The check requires it inside that deadline and requires the node to have accepted the block, since a rejection or an RPC error is also an answer. The kill's census of re-offers is in the evidence; possible losses are reported, not gated, as for the mid-flight kill. - With the public API on the standby, the pool-exhaustion window is no longer excluded from its figures; that fault takes only the primary's slots. - --faults is refused under --plan soak and in a soak's looped presets until #556, where the verdict would otherwise go missing. Ordering, cleanup and timing: - The faults phase now runs after every other phase, as documented. The phase used to come before mid_flight_kill, so a fault cut short by the phase bound could leave a frontend down for that phase to report as a crash. - The phase bound gives rolling-restart one allowance per frontend. - The settlement-lock /metrics sampler stops when its recovery window closes. - The read tier starts before the phase's clock, so the per-second buckets line up with the fault windows. - The lock's release is stamped as ROLLBACK is sent. - A finished task's handle is polled in place, so a Pending cannot drop its result. - A lock holder that fails before taking the lock reports its own error. - The relay forwards to the node's origin plus the path the call came in on, instead of doubling a node URL path. The new unit tests pin the phase order (they fail on the old order), the rolling-restart bound, the soak refusal and what counts as an accepted block. faults-pr-smoke passes in 33-34 s, as before (no added per-PR cost). Refs #554 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Member
Author
Review ledger: #623 (Refs #554)Lanes run
Every finding was checked against the code. The fixes are in one follow-up commit, 2a81d96. Fixed
Rejected
Verification
|
2 tasks
Anatolie
added a commit
that referenced
this pull request
Sep 30, 2026
Brings in #623's --faults (pinned null in every preset), #615's ORDER_LOCK hold measurements and the other 3.x.x commits since 72efbcb/1932cb30. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Anatolie
added a commit
that referenced
this pull request
Sep 30, 2026
…#511) #623 added --faults and pinned it null (no fault phase) in every preset, so every preset stopped resolving against 5d0042f, which has no such flag. A build older than the flag ran no fault phase, which a pinned null still means, so legacy-flags.json now says so (introduced at b7bbbbe). Co-Authored-By: Claude Opus 5.5 <[email protected]>
25 of 40 tasks
This was referenced Oct 1, 2026
RobertClarke
added a commit
that referenced
this pull request
Oct 6, 2026
… preset flags, and document L3 in the lanes page (#550) #608 was stacked on an earlier #564. Since then #564's `compare::Build` gained `predates_report_fields`. A collation summarizes one build, the plan's commit, which predates no report field, so the list is empty. 3.x.x added two result flags every checked-in preset must pin: `--ctv-settlement` (#644) and `--faults` (#623). The three new presets pin `false` and `null`, as the presets they derive from do, so each differs from its source only in `--cadence` and `--scheduled-blocks` (and the dense 1-frontend cell in its runner and schedule). docs/prism-e2e-load-ci.md did not exist on #608's base. It now has #626's L3 section: the lane table's row, the suites and triggers, what L3 proves and does not, the dispatch commands and the evidence rows. One correction to the draft: dispatch, like the weekly schedule, needs the workflow file on `main`, so the status says L3 runs on pull requests and tags until the file is mirrored there. Co-Authored-By: Claude Opus 5.5 <[email protected]>
RobertClarke
added a commit
that referenced
this pull request
Oct 6, 2026
… them in the lanes page, and note that #548 has landed (#555) 3.x.x added two result flags every checked-in preset must pin: `--ctv-settlement` (#644) and `--faults` (#623). The two session points pin `false` and `null`, as `throughput-400k-window-2fe-async` does, so they still differ from it only in `--sessions` and `--stratum-max-pending-initial-jobs`. #548 (CTV fanout settlement in the harness) landed as #644. The 10,000-recipient point still has no preset, but the README, the suite comment and the scenario manifest now say it can be written with `--ctv-settlement` on, rather than that it waits on #548. The 50,000-recipient trigger is evaluated once that preset runs. docs/prism-e2e-load-ci.md gets #626's parts for this change: the `l3-reduced` row's nine presets, its cost of about 200 runner-minutes a week, and the capacity-envelope paragraph. Co-Authored-By: Claude Opus 5.5 <[email protected]>
RobertClarke
added a commit
that referenced
this pull request
Oct 6, 2026
… preset flags, and document L3 in the lanes page (#550) #608 was stacked on an earlier #564. Since then #564's `compare::Build` gained `predates_report_fields`. A collation summarizes one build, the plan's commit, which predates no report field, so the list is empty. 3.x.x added two result flags every checked-in preset must pin: `--ctv-settlement` (#644) and `--faults` (#623). The three new presets pin `false` and `null`, as the presets they derive from do, so each differs from its source only in `--cadence` and `--scheduled-blocks` (and the dense 1-frontend cell in its runner and schedule). docs/prism-e2e-load-ci.md did not exist on #608's base. It now has #626's L3 section: the lane table's row, the suites and triggers, what L3 proves and does not, the dispatch commands and the evidence rows. One correction to the draft: dispatch, like the weekly schedule, needs the workflow file on `main`, so the status says L3 runs on pull requests and tags until the file is mirrored there. Co-Authored-By: Claude Opus 5.5 <[email protected]>
RobertClarke
pushed a commit
that referenced
this pull request
Oct 6, 2026
…didate, v* tags and weekly (#550) (#608) Refs #550 (S5 of #487). prism-load-l3.yml runs #447's production-window matrix as checked-in suites (crates/qbit-prism-load/presets/suites.toml): - l3-full: 11 cells x 3 repeats on the 32 vCPU class. It runs on a same-repository PR that changes VERSION, on the release-candidate label, on a v* tag and on dispatch. - l3-reduced: 400k at 1, 2 and 4 frontends, weekly on 3.x.x. #473's found-block and dense-cadence cells become presets. qbit-prism-load-compare --collate renders one build's suite into #473's tables with #511's summarizer. It writes a complete/passed verdict, and lists any missing, foreign or edited run as failing the suite rather than dropping it. A tag promotes the newest finished same-repository PR run of l3-full whose verdict is complete for the tagged tree (scripts/prism_l3_promote.py), and carries that verdict; otherwise it runs the suite. check_e2e_scenarios.py gains a suites evidence key beside 3.x.x's lane_checks. Taken over per #626 and restacked onto 3.x.x after #564. The new presets pin --ctv-settlement false and --faults null, as every preset must since #644 and #623. collate fills #564's predates_report_fields. docs/prism-e2e-load-ci.md gets #626's L3 section, which notes that dispatch and the weekly run need the file on main. Spend: once this is on 3.x.x, a v* tag or a VERSION-changing PR starts l3-full (about $42); the coordinator accepted that for the release-candidate bump. Co-Authored-By: Claude Opus 5.5 <[email protected]>
RobertClarke
added a commit
that referenced
this pull request
Oct 6, 2026
… them in the lanes page, and note that #548 has landed (#555) 3.x.x added two result flags every checked-in preset must pin: `--ctv-settlement` (#644) and `--faults` (#623). The two session points pin `false` and `null`, as `throughput-400k-window-2fe-async` does, so they still differ from it only in `--sessions` and `--stratum-max-pending-initial-jobs`. #548 (CTV fanout settlement in the harness) landed as #644. The 10,000-recipient point still has no preset, but the README, the suite comment and the scenario manifest now say it can be written with `--ctv-settlement` on, rather than that it waits on #548. The 50,000-recipient trigger is evaluated once that preset runs. docs/prism-e2e-load-ci.md gets #626's parts for this change: the `l3-reduced` row's nine presets, its cost of about 200 runner-minutes a week, and the capacity-envelope paragraph. Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.
Refs #554 (#487 S16). This is the first of two PRs, as agreed in the design on #554: the fault injector and seven of the faults. The second PR adds the primary kill with async promotion, a block mid-landing across failover, a full WAL disk and a restart over a candidate backlog, on #588's weekly selection. No server code changes.
What
qbit-prism-load --faults <fault>[,<fault>...][;<key>=<value>...]adds afaultsside phase after every other phase (src/fault/). Each fault runs while the sessions keep mining, in this order: a baseline window, the injection (held forholds, or, for a restart, until the frontend serves again), the removal and a recovery window. The driver is polled from the scheduling loop, as the drained restart and the mid-flight kill are, so the other sessions keep getting load. The phase ends when the last fault has recovered.Each fault is held to its criteria, on top of the run's own contract: every acknowledged share is in PostgreSQL, no committed share goes unanswered mid-run, and one
submitblockper block hash.slow-database--slow-db-delay-ms.--ack-p99-limit-ms, 2 × the baseline's).pool-exhaustionsettlement-lockSETTLEMENT_LOCK, and a tip is minted halfway through.PRISM_SUBMIT_TIP_MAX_AGE_SECONDS. After that the server refuses shares it cannot prove current, as designed; those refusals are counted, not failed. No session gets work on the tip before the release, and every session has it within 10 s of the release. ACK p50, p99 and max over the hold are recorded.frontend-sigkillsubmitblockis forwarded and its reply withheld. The offering frontend is then killed and relaunched, with the mid-flight kill's census and re-offers.sigterm-drainsubmitblockis held 500 ms, and the offering frontend gets SIGTERM as the call arrives.acceptedis recorded on the candidate before the process exits (#578, #585).rolling-restartreconnect-stormstorm, 0.5) drop abruptly and come back within 5 s.public-apiprocess on the standby, polled at 5 requests/s acrosspool-summary,blocks,leaderboardandhashrate-series, and every frontend's/metricsevery 5 s./metricsanswers within 1 s (#189's class, #469).The API for #556:
order=randomdrawscountfaults with a seeded stream, withgap=<min>..<max>between them. The drawn sequence is in the report, so a failed soak replays.baseline,hold,recovery,read-tier,stormandlease-wait.The relay. A per-frontend JSON-RPC relay sits in front of the node, fake or real. It can hold the next
submitblockfor a set time, or forward it and withhold the reply. Each call is carried by its own task, so a frontend that gives up on a call does not cancel it. Only a run with a fault phase launches its frontends on the relay; every other run's node path, and its side report's keys, are unchanged.The verdict is the side report's
faultsblock. It has one row per fault, with:Exit 9 is new: a fault that missed a criterion in a run that otherwise reconciled. The gate prints one row per fault and one for the read tier.
Where it runs, and what it costs
faults-pr-smokeqbit-prism-load::faults::…, shard 1 of 4 besidereal_nodesigterm-drainandsettlement-lockfaults-short-real-nodeThe weekly long set, with 2,000 sessions and the PR2 faults, comes with PR2 on #588's weekly selection.
tests/faults.rsbuilds the server the way #617 now hasload_smoke,real_nodeandsoak_smokedo: with-p qbit-prism-loadselected too, and without the variablescargo testsets for the test process (CARGO_PKG_*,CARGO_MANIFEST_*and the rest), whichring's build script tracks. The nested build is then 0.1 s instead of about 21 s.Adding the
faultstest target shiftsrun_rust_test_shard.py's round-robin assignment for the targets after it, as any new test binary does.Changes outside
src/fault/run.rs: the relay's URL for each frontend (fault runs only), the phase hook, the frontend-exit check skipping a planned outage, the verdict and exit 9.cli.rs/preset.rs:--faults, withnullmeaning off. Every preset pins"--faults": null; that one line is its only change.node.rs:MintPurpose::Fault.gate.rs: the per-fault rows.check_e2e_scenarios.pyknows thefaultsbinary as a scenario and smoke binary, with a fixture test.test/e2e-scenarios.toml: the 3.x.x: Fault injection under load (L4/L5) (#487 S16) #554 placeholders become eight running entries, one per fault plus the read tier, each with its criteria, and four planned PR2 entries.README.md: a section on the faults, and exit 9.Tests and mutants
Checks run:
cargo fmt --check, andcargo clippy --workspace --all-targets -D warnings.qbit-prism-load's lib (including 12 new unit tests: the plan parser and seeded draw, the relay URL and block hash, the read-tier verdict, the gate rows, the lock key),harness(138),realism,churnandsoak_plan.load_smoke,real_node,quorum_replicationandsoak_sampling, and the opt-in nightlysoak_smoke(all pass, with the fake-node key-set golden unchanged; 3.x.x: long soak automation: a one-lifetime soak plan for the load harness, a weekly 5.5 h soak and a deployment soak report (#575) #588's three soak presets pin"--faults": nulltoo).check_e2e_scenarios.py,check_gate_env_reads.py,check_prism_settings.py,check_deleted_test_map.pyandcheck_version_skew.py.PRISM_TEST_REQUIRE_INTEGRATION=1: the new gated test passed 11 of 11 runs while it was written, 3 of 3 rebased on 3.x.x: long soak automation: a one-lifetime soak plan for the load harness, a weekly 5.5 h soak and a deployment soak report (#575) #588, 3.x.x: run the load nightly on a run-load label, skip unchanged nights, report scheduled failures, and fingerprint each preset's host (#549) #596, 3.x.x: run the shipped images under the Compose prism profile with the HA overlay, weekly and on Dockerfile or Compose changes (#544) #597 and 3.x.x: Record the D1 production-window load matrix (200k/400k/500k) that #271 could not run #473, and 2 of 2 on the final tree after 3.x.x: report the weekly soak's resident-memory failure as expected on #600, and fail once it looks fixed (#600) #611, 3.x.x: deliver a job build that a same-tip republication overtakes, so publications faster than one fan-out no longer starve job delivery (#598) #616 and 3.x.x: remove Config::block_only_ack_timeout, share the mature-CTV-fanout fixture, and stop the load tests rebuilding the server's dependencies (#579, #580) #617. On the final tree: fmt, workspace clippy,harness,soak_plan,check_e2e_scenarios.pyand its tests were run again; the other checks below ran on the tree before 3.x.x: report the weekly soak's resident-memory failure as expected on #600, and fail once it looks fixed (#600) #611, 3.x.x: deliver a job build that a same-tip republication overtakes, so publications faster than one fan-out no longer starve job delivery (#598) #616 and 3.x.x: remove Config::block_only_ack_timeout, share the mature-CTV-fanout fixture, and stop the load tests rebuilding the server's dependencies (#579, #580) #617, which touch none of this PR's files.Mutants. Each was applied to the server, built, run and reverted. M2 was run again on the final tree.
faultstestthe shutdown waited for the offer(not logged) andthe node's answer was recorded before the process exited(row leftoffer_reserved)SETTLEMENT_LOCKfaultstestno share waited on the lock holder(ACK p99 5.2 s) andshares on retained work accepted…(19 of 40 accepted, 21ledger-confirmation-failed); exit 9offer_reservedrow callssubmitblockagain (#531's M1)frontend-sigkillon the fake nodethe block reached the node exactly once(forwarded twice)The nightly preset on the real node (a debug build on a shared host with 1-minute load 2–6.5) exited 0 twice, in 510 s and 532 s. Every fault passed, and the public API answered 2,139 of 2,139 requests with p99 48 ms. On the final tree it ran once more the way the nightly does (
prism-load-run.sh, release builds, 1-minute load about 12): gate PASS in about 9 min, every fault passed, and the public API answered 2,027 of 2,027 with p99 74 ms. What the first two runs measured:frontend-sigkill: the block landed 124–144 s after the kill (the candidate lease), exactly once.sigterm-drain: exit 0.53 s after SIGTERM, withacceptedrecorded.settlement-lock(30 s): ACK p50 5.4 ms, p99 71 ms, max 298 ms. 49 of 1,500 shares were refusedbackend-rpc-unavailableonce the stall passed the tip's max age.slow-databaseat 20 ms one way: 438 of 1,336 shares accepted and the rest refused truthfully (ledger-confirmation-failed518,backend-rpc-unavailable380). Nothing was lost and there was no divergence: this is the 3.x.x: The 2,000 shares/s burst ceiling is about a fifth lower ona1937054than on5d0042f6, same host #479 ceiling.Not covered here
🤖 Generated with Claude Code
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.