Repository navigation
3.x.x: attribute build deadlines to known revision-work waits only (#493) - #500
Merged
Merged
Conversation
) After a lost or cancelled settlement COMMIT reply, the accepting frontend's landing tracking is unknown for that block (`unknown_revision`), yet the block still counted toward `pending_count`. `revision_work_build` derived `Build.pending` from that raw count (or saturation), so every later initial-job deadline, including admission and database waits unrelated to the block, incremented `revision_work_build_timeouts_total` and stamped `degraded` on the unknown wait (#493 point 5). `Build.pending` now comes from the known waits only: open identities with neither a lost settlement reply nor an unsettled orphan verdict, and no lost ordering history, which is exactly the set the pending gauge reports. While only unknown tracking remains, a deadline hit is an ordinary `job_delivery_failures_total` event, the tracking-unknown gauge keeps reporting the unknown state and the pending gauge stays -1; nothing is counted as a revision-work failure or as zero. A known wait beside unknown tracking still attributes its deadline as before. Mining, delivery, fences and the #493/#496 paging rules are unchanged; HELP, inventory and the rule basis state the known-wait rule. Tests: three landing unit tests (lost settlement reply with a recovering first confirmation, known wait beside unknown tracking, unsettled orphan verdict, untrackable identity and lost ordering); one PostgreSQL-gated test that loses a real COMMIT reply through the wire proxy and then holds a real Stratum initial-job build at admission until its deadline; two promtool scenarios for the corrected series (unknown-only with no timeout, unknown beside a known 308 s stall with a real timeout). Co-Authored-By: Claude Fable 5.1 <[email protected]>
…493) Review finding F1 on #500: `Build.pending` is a snapshot at the build's start, so a wait that was unknown then (lost settlement reply) and recovered through a proven first confirmation while the build was in flight was not attributed when the deadline fired, and its later delivery read `published`; the base counted that deadline. `deadline_hit` now also attributes when a known wait accepted before the build is open at the deadline instant; the degraded stamp for open waits accepted before the build is unchanged. Unknown-only tracking at both instants still counts nothing. The reviewer's discriminating test is adopted as a regression test; the inventory prose and metadata state the two attribution instants. Co-Authored-By: Claude Fable 5.1 <[email protected]>
Member
Author
Review ledger (final)Head: Lanes
Findings and dispositions
Verification of The #494 carry-over threads are assessed on #493; nothing from them is folded into this PR. |
27 of 28 tasks
8 of 10 tasks
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 #493 (point 5). Telemetry attribution only: no landing, delivery, fence, paging-rule or deployment change.
Problem
A lost or cancelled settlement COMMIT reply leaves the accepting frontend's tracking for that block unknown (
unknown_revision), by design. The block still counted towardpending_count, andrevision_work_buildderivedBuild.pendingfrom that raw count (or from saturation). Every later initial-job deadline on that frontend, including admission and database waits with no relation to the block, then incrementedrevision_work_build_timeouts_totaland stampeddegradedon the unknown wait, until restart. Reproduced first with failing tests: a unit test that drops a settlement and times out a build (counter read 1, expected 0), and a PostgreSQL-gated test that loses a real COMMIT reply through the wire proxy and then holds a real Stratum initial-job build at admission past its deadline (same false count).Change
Build.pendingis computed from the known waits only: open identities with neither a lost settlement reply nor an unsettled orphan verdict, and no lost ordering history. This is the same set the pending gauge reports, so the counter and the gauge now agree. Saturation without a known wait no longer counts either: it is unknown, and the tracking-unknown gauge already reports it.job_delivery_failures_totalevent; the tracking-unknown gauge stays 1, the pending gauge stays -1, nothing is counted as a revision-work failure and nothing is reported as zero. A later proven first confirmation that recovers the wait is not stampeddegradedby a deadline the build never attributed.docs/prism-native-metrics.md, the metric metadata and thePrismRevisionWorkBuildTimeoutsbasis state the known-wait rule; migration table and the review-only qbit-tools patch regenerated (specification SHA-256 changed).Verification
Local, on the branch head, with a worktree-local target and the shared build lock:
metrics::landingunit tests 22/22; the wholelanding_metricsgated binary 35/35 against PostgreSQL 16.15 with fsync on, gate manifest showing all 17 of its gated tests executed including the new one;observabilitytest binary green.cargo fmt --all --check;cargo clippy --locked -p qbit-prism-server --all-targets -- -D warnings.scripts/test_prism_alert_promql.pywith the CI-pinned promtool 3.14.0: 33 expressions, 120 scenarios, 233 expression assertions, 145 alert assertions, including the two new scenarios;generate_prism_metrics.py --checkandgenerate_prism_alerts.py --checkclean;test_prism_alert_deployment.py --snapshotagainst the reviewed snapshot: patch applies, 10 gate combinations, 78 original / 67 proposed rules.live_regtest; CI is the evidence for those. No timing runs.Review ledger
645f535c(no blockers, one minor F1, two notes).deadline_hitnow also attributes when a known wait accepted before the build is open at the deadline instant; the reviewer's discriminating test is adopted as a regression test. F2 (saturation and lost ordering stay silent on the counter, by design, exposed by the tracking-unknown gauge) and F3 (a wait closed mid-build still counts, pre-existing) are unchanged.🤖 Generated with Claude Code