Skip to content

3.x.x: wait, within a bound, for the failover standby to flush a found block's reservation before submitblock (#529) - #570

Merged
djh58 merged 2 commits into
3.x.xfrom
djh58/prism-b529-offer-standby-flush
Sep 29, 2026
Merged

djh58 merged 2 commits into
3.x.xfrom
djh58/prism-b529-offer-standby-flush

Conversation

@djh58

@djh58 djh58 commented Sep 29, 2026 •

Copy link
Copy Markdown
Member

Closes #529 (item c). Refs #291.

Why

Under asynchronous D3 the replication gap can hold a found block's candidate row and offer reservation as well as shares. The #531 drills showed a block found in the gap loses its outbox row with the primary. If that block was already offered, it is on chain with no candidate, audit or qbit_pool_blocks record on the promoted primary, and no code path lands an on-chain block without its candidate row. The #529 prototype comment measured the narrowest fix; this PR turns it into a production feature.

What

After a found block's offer reservation commits, the offering frontend reads the primary's pg_current_wal_flush_lsn() (which covers the candidate row and the reservation) and polls pg_catalog.pg_stat_replication until the flush_lsn of every standby connected under that name (streaming, or catchup after a reconnect) reaches it. Only then does it call submitblock. The wait runs before the strictly-live renewal, so the token fence stays immediately before the send. It targets flush_lsn, what synchronous_commit=on would wait for; sent_lsn or write_lsn would not survive a promotion.

Setting Default Meaning
PRISM_OFFER_STANDBY_APPLICATION_NAME unset (off) The dedicated failover standby's application_name, at most 63 printable ASCII bytes
PRISM_OFFER_STANDBY_FLUSH_WAIT_MS 250 The bound; 0 turns the wait off; at most 10000

It never holds the block.

Outcome When What happens
confirmed the standby flushed through the reservation offered; INFO log with waited_us
absent no standby connected under that name offered at once; WARN with the block hash
lagging still behind at the bound offered at the bound; WARN with the hash and lag_bytes
failed database error, no answer before the bound, or a writer role without pg_read_all_stats offered; WARN with the hash and the error
  • synchronous_standby_names stays empty. No commit waits for the standby, so share appends and their ACKs are unchanged and D3 is unchanged. Block-only proofs are the one exception: their ACK already waits for their candidate's disposition, so a lagging standby delays those ACKs by the bound.
  • Each poll takes a pooled connection and returns it before the 1 ms pause. One timeout covers every checkout and read.
  • Metric and alert: qbit_prism_block_offer_standby_wait_total{outcome} counts every wait (all four series start at zero). PrismBlockOfferStandbyUnconfirmed is a warning (never pages) on any non-confirmed outcome in the last 30 minutes, with no dwell, gated on a fresh snapshot. It is generated into the migration table and the qbit-tools patch.
  • self-check refuses a configured wait whose writer role cannot read replication positions (GRANT pg_monitor), or whose name does not match exactly one connected standby reporting its flush position, and reports what it read under offer_standby. check-config prints the effective setting.
  • Settings inventory, Compose (${PRISM_OFFER_STANDBY_APPLICATION_NAME:-}, so off by default), .env.example and the server README.
  • Docs. The HA reference gets a found-block section: behaviour, grant, measurements and the amended accepted-loss statement. It also gets promotion step 6, which reconciles the logged hashes after a failover. A surviving candidate needs nothing. No candidate and not on the active chain means only the reward was lost. No candidate but on the active chain is an accounting-loss reconciliation, because its coinbase paid balances the promoted ledger still carries, and candidates recover refuses a hash with no row. The ledger operations guide points to it.
  • Next to 3.x.x: Cutover qualification — migration rehearsal, failover drill, soak, go/no-go #291's sync experiment, the HA reference now records that PostgreSQL disables statement_timeout before the COMMIT's synchronous-replication wait (finish_xact_command() → disable_statement_timeout() → CommitTransactionCommand()). With the standby down, a SET LOCAL synchronous_commit=on COMMIT blocked for 18.7 minutes despite statement_timeout=2s, until pg_cancel_backend. So a statement timeout cannot be the duration guard.

With the wait on, the accepted asynchronous loss is:

  • acknowledged shares in the last replication gap;
  • found blocks whose offer logged an unconfirmed wait;
  • found blocks never offered before the primary was lost.

Tests

All gated and listed, sorted, in test/prism-gated-tests.txt:

Test What it proves
live_regtest::pg_failover_tests::offer_standby::a_found_block_offered_after_the_standby_flush_survives_a_replication_cut_at_submitblock #531 fixture, real regtest mining, 400 ms lagging replication link, replication cut the moment the found block reaches the node, then fence / stop / promote / move. The promoted primary holds the reservation, the held attempt records accepted, and the block lands once with one audit bundle, is confirmed, offered exactly once, and passes carry-forward integrity
postgres_failover::offer_standby_flush::offer_standby_wait_confirms_the_flush_returns_at_the_bound_and_never_waits_for_a_stopped_standby Disposable primary/standby with a non-superuser writer that owns the database. Without pg_monitor it reports failed at once and self-check refuses it. After the grant it confirms. With the standby's WAL receiver suspended it returns lagging at the bound (≥ bound, < bound + 2 s) with the lag, and confirms again after resume. A second standby under the same name whose WAL receiver is suspended keeps the wait from confirming (it lags to the bound although the first standby flushed) and self-check refuses the name. A stopped standby is absent at once and self-check refuses it. Another application name is not waited for
coordinator::candidate_lease_tests::offer_standby_tests::a_found_block_is_offered_at_once_when_the_configured_standby_is_not_streaming Real offer path: bound 10 s, offered well inside it, landed once, counted absent
coordinator::candidate_lease_tests::offer_standby_tests::with_the_standby_wait_off_a_found_block_is_offered_without_a_wait Wait off: landed once, nothing counted
config::tests::offer_standby_wait_needs_a_name_and_a_positive_bound (unit) Parsing, bounds, name validation

Seven promtool scenarios cover: fires at once, holds for the 30-minute window, clears after it, confirmed offers never warn, lagging and failed warn per frontend, a counter reset alone does not warn, and a stale snapshot defers to the snapshot rules.

Mutants (each fails at least one test)

Mutant Caught by
No wait drill (offered before the standby held its reservation (standby row: None)), absent test
sent_lsn instead of flush_lsn drill (same), pair test (Confirmed { waited: 475µs } while the standby flushed nothing)
An absent standby waited for until the bound pair test, absent test (the offer took 10.1s)
No privilege check pair test (Absent instead of failed)
Counter not recorded absent test
Confirm when any same-named standby flushed (bool_or) pair test (twin standby)
Alert: lagging dropped / 5 m window / confirmed counted / 3 m dwell promtool scenarios

Verification

Share ACK A/B

The load harness (qbit-prism-load) ran with its managed asynchronous standby (application_name=prism_standby_1, synchronous_standby_names='') and one debug frontend. Each arm had 100 sessions, 50 shares/s and 10 scheduled own blocks in a 60 s steady state. The feature was on (PRISM_OFFER_STANDBY_APPLICATION_NAME=prism_standby_1, 250 ms bound) or off. There were eight interleaved arms, each under the exclusive timing lock on a quiet host (1-minute load 0.5 to 1.4). These are example artifacts (debug build, dirty tree), so read them as a relative A/B.

Arm Client ACK p50 / p90 / p99 (ms) Mean (ms) Server ACKs > 250 ms Standby waits
off (4 runs) 4.47–4.61 / 5.55–5.74 / 12.4–15.1 4.90–6.37 0, 0, 0, 1 —
on (4 runs) 4.52–4.62 / 5.58–5.69 / 12.8–13.7 4.93–7.73 1, 0, 2, 0 40 of 40 confirmed, 0.7–2.6 ms (p50 about 1.9 ms)

Share ACK latency is unchanged. The rare ACKs of about 3.6 s appear in both arms (one off run, two on runs) and never in a window with a block offer's wait above 2.6 ms. They come from the harness host, not the wait. On a healthy standby the wait adds 1 to 3 ms before each found block's submitblock and nothing to share ACKs. The prototype's lagging-standby arm (every offer held for the bound, and block-only proof ACKs with it) is in the #529 comment.

Per-PR CI runtime added

About 10 s in total, all inside existing test binaries, with no new binary to link:

Shared-code changes (additive)

  • offer_standby: None added to every Config literal in tests and test support: one line each, as 3.x.x: An own block found 9 s after the previous landing was refused unknown-job and never reached the node #478 did for its setting.
  • tests/support/live_pg_failover.rs: Relay gains an optional per-connection delay on the target-to-client direction (default 0, unchanged path) and sets TCP_NODELAY on relayed sockets, since without it small replies waited about 40 ms. It declares the new child module.
  • One #[path] mod line each in postgres_failover.rs and candidate_lease_tests.rs; the observability census counts (+1 family, +4 series).

Accepted trade-off

The wait sits between the durable reservation and submitblock. That widens the window in which a crash or a lost claim leaves a block reserved but never sent, from one round trip to at most the bound (250 ms by default, 10 s at most). Recovery treats such a block as delivery unknown and never offers it. This is the price of keeping the reservation on the standby, which lets a held attempt record its outcome on the promoted primary. It is stated at the call site, in the module and in the HA accepted-loss list.

Not covered

This is a disposable fixture. It does not qualify the operator's real standby, fencing or endpoint (#291). It does not address #529 (a), the recovered outcome record, or (b), the 120 s lease delay after a mid-landing failover.

🤖 Generated with Claude Code

…d block's reservation before submitblock (#529)

Under asynchronous D3 the replication gap can hold a found block's
candidate row and offer reservation as well as shares. A block offered to
the node whose rows are then lost with the primary is on chain with no
candidate, audit or pool-blocks record on the promoted primary, and no code
path lands an on-chain block without its candidate row (#529 item c).

After the offer reservation commits, the offering frontend now reads the
primary's pg_current_wal_flush_lsn(), which covers the candidate row and
the reservation, and polls pg_catalog.pg_stat_replication until the named
standby's flush_lsn (state streaming) reaches it, then calls submitblock.
It runs before the strictly-live renewal, so the token fence stays
immediately before the send. flush_lsn is what synchronous_commit=on would
wait for; sent_lsn or write_lsn would not survive a promotion.

- PRISM_OFFER_STANDBY_APPLICATION_NAME (unset = off) and
  PRISM_OFFER_STANDBY_FLUSH_WAIT_MS (default 250, 0 = off, at most 10000),
  parsed into Config, printed by check-config, wired through Compose and
  .env.example, and listed in the settings inventory.
- The wait never holds the block: a standby that is not streaming is not
  waited for (absent); at the bound the block is offered anyway (lagging);
  a database error or a writer role without pg_read_all_stats is reported
  at once (failed). Every outcome but confirmed logs the block hash at WARN
  for post-failover reconciliation. Each poll takes and returns a pooled
  connection; one timeout covers every checkout and read.
- synchronous_standby_names stays empty: no commit waits, shares and their
  ACKs are unchanged. D3 is unchanged.
- qbit_prism_block_offer_standby_wait_total{outcome} (all four series start
  at zero) and a PrismBlockOfferStandbyUnconfirmed warning (any
  non-confirmed outcome in 30 minutes, no dwell, never pages), generated
  into the migration table and the qbit-tools patch, with seven promtool
  scenarios.
- self-check refuses a configured wait when the writer role cannot read
  replication positions (GRANT pg_monitor) or the name matches no single
  streaming standby, and reports what it read.
- Docs: the HA reference gains a found-block section (behaviour, grant,
  measurements, the amended accepted-loss statement) and promotion step 6,
  reconciling the logged hashes after a failover; the ledger operations
  guide points to it. Next to #291's sync experiment it records that
  PostgreSQL disables statement_timeout before the COMMIT's sync-rep wait:
  with the standby down a SET LOCAL synchronous_commit COMMIT blocked for
  18.7 minutes despite statement_timeout=2s, so a statement timeout cannot
  be the duration guard.

Tests (all gated, listed in test/prism-gated-tests.txt):
- live_regtest offer_standby drill on the #531 fixture: a 400 ms lagging
  replication link, cut the moment the found block reaches the node, then
  fence, stop, promote and move the endpoint. The promoted primary holds the
  reservation and the block lands once.
- postgres_failover offer_standby_flush on a disposable primary/standby
  pair with a non-superuser writer: fails fast without pg_monitor (and
  self-check refuses), confirms after the grant, returns at the bound with
  the lag while the standby's WAL receiver is suspended, confirms after it
  resumes, does not wait for a stopped standby (self-check refuses), and
  ignores another application name.
- coordinator offer_standby_tests: an absent standby lets the block go at
  once (counted absent, landed once); with the wait off nothing is counted.
- Config parsing unit test.

Mutants caught: no wait (drill, absent test); sent_lsn instead of flush_lsn
(drill, pair test); an absent standby waited for until the bound (pair
test, absent test); no privilege check (pair test); counter not recorded
(absent test); alert without lagging, with a 5 m window, counting
confirmed, or with a 3 m dwell (promtool scenarios).

Closes #529
Refs #291

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@djh58
djh58 requested a review from kiwidream September 29, 2026 13:40
@djh58

djh58 commented Sep 29, 2026

Copy link
Copy Markdown
Member Author

@cursor review

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 3b0228a. Configure here.

…ushed, and document the reserved-but-unsent window (#529 review)

From the #570 review lanes:

- A second standby sharing the application_name, or a lingering walsender
  from a dropped connection, could confirm the wait for the standby that
  had not flushed (ORDER BY flush_lsn DESC LIMIT 1). The wait now confirms
  only when every connected standby under the name has flushed through the
  target, so such a row can delay it to the bound but never confirm it
  falsely. Runtime and self-check read the same rows (one STANDBY_ROWS
  predicate), and self-check refuses a name matching more than one standby
  or one that has not reported a flush position yet.
- A standby in state catchup after a reconnect counted as absent and got no
  wait; connected standbys in streaming or catchup are now waited for.
- The wait widens the window in which a crash or a lost claim leaves a block
  reserved but never sent, from one round trip to at most the bound. That
  is the price of keeping the reservation on the standby; it is now stated
  at the call site, in the module and in the HA doc's accepted-loss list.
- StandbyWait { waited, durability } replaces the per-variant waited field;
  durability.outcome() returns the metric label, so the second four-case
  label mapping and the nested result go away, and the coordinator logs one
  INFO or one WARN (fields and message prefix unchanged).
- The poll's read ceiling (bound / 1 ms) is documented, and the HA doc no
  longer claims write_lsn is tested.

The postgres_failover pair test adds a second standby under the same name
whose WAL receiver is suspended: the wait lags to the bound although the
first standby flushed, and self-check refuses the name. A mutant that
confirms when any same-named row flushed (bool_or) fails it; the earlier
mutants (no wait, sent_lsn, absent waited to the bound, no privilege check,
no counter) still fail their tests.

Refs #529

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@djh58

djh58 commented Sep 29, 2026

Copy link
Copy Markdown
Member Author

deep-review ledger (head 69402750)

Stakes: high, because the change sits on the found-block submission path (block rewards). Lanes run:

  • /code-review (medium effort)
  • a thermo-nuclear quality review
  • an adversarial review (Claude)

The second, cross-provider adversarial lane was not run: this work is limited to Claude models. No review bots commented on this PR.

# Source Finding Disposition
1 code-review No findings —
2 thermo (blocking) The wait sits between the durable reservation and submitblock. That widens the window in which a crash or lost claim leaves a block reserved but never sent (delivery unknown, never offered) from one round trip to the bound, and this was not documented Fixed in 69402750. The window is stated at the call site, in ledger/standby_durability.rs and in the HA doc's accepted-loss list. It stays capped at 10 s (default 250 ms) because keeping the reservation on the standby is what lets a held attempt record its outcome on the promoted primary
3 thermo H1 + adversarial 2 ORDER BY flush_lsn DESC LIMIT 1 let a second standby under the same name (or a lingering walsender) confirm for one that had not flushed; runtime and self-check read different rows Fixed in 69402750. The wait confirms only when every connected standby under the name has flushed (bool_and). One STANDBY_ROWS predicate is shared with self-check, which refuses a name matching more than one standby. New pair-test case: a same-named twin with its WAL receiver suspended lags the wait to the bound, and a bool_or mutant fails it
4 adversarial 1 A standby in catchup after a reconnect counted as absent Fixed in 69402750: streaming and catchup rows are both waited for
5 thermo H2 Per-variant waited, a second four-case label mapping, a triple-nested Result and four near-identical log calls Fixed in 69402750: StandbyWait { waited, durability }, durability.outcome() returns the metric label, and one INFO or WARN is logged. The log fields and message prefix are unchanged
6 thermo L2 The poll's read ceiling was not stated Fixed in 69402750: at most bound / 1 ms reads per found block, and only while a standby is behind
7 adversarial 4 The docs presented write_lsn as tested Fixed in 69402750. The HA doc now says sent_lsn is covered by the drill and the pair test, while write_lsn differs only across a crash of the standby host, which the tests do not exercise
8 adversarial 3 Self-check would accept a standby with wal_receiver_status_interval=0 that never reports flush_lsn Rejected: on PostgreSQL 16.15 a standby with SHOW wal_receiver_status_interval = 0 still reported flush_lsn advancing to the primary's flush position within 1 s of a commit, so the scenario does not occur. Self-check still refuses a connected standby that has not reported a flush position yet (a cheap guard)
9 thermo M1 Move Relay and its delay into its own support/relay.rs Deferred: other lanes are editing that shared test support concurrently, so this PR keeps its changes there additive. A good follow-up once they land
10 thermo M2 OfferStandbyWait invariants are enforced only by the config parser Rejected: the setting is validated once at the configuration boundary, like every other setting here, and the type is only built from Config and in tests
11 thermo L1 strip_ansi duplicates a helper in another test file Deferred, together with 9
12 thermo L3 Every new Config field costs one line in 14 test literals Deferred: a shared test-config builder is its own refactor across files other lanes are editing
13 thermo L4 The mechanism is described in several docs, and the statement_timeout write-up belongs to #291 Rejected: the task asked for the statement_timeout finding next to #291's sync experiment in the HA doc. The ops guide keeps only the runbook and links to the HA section
14 adversarial 5 A bound that expires during a pool checkout records a database_pool_acquire_seconds{result="failure"} sample Deferred: every timeout-wrapped checkout already does this. It happens only when the pool is already saturated at a found block, which the pool-wait alert reports anyway

Verification on 69402750:

  • fmt and clippy -D warnings are clean.
  • Passing tests:
    • the lib offer-standby tests;
    • postgres_failover, including the twin-standby case;
    • observability;
    • the live drill.
  • Every code mutant fails its test: no wait, sent_lsn, bool_or, absent waited to the bound, no privilege check, no counter.
  • The alert generators and the deployment check pass.
  • CI is green (all checks).

@djh58
djh58 merged commit b6df571 into 3.x.x Sep 29, 2026
21 checks passed
djh58 added a commit that referenced this pull request Sep 29, 2026
…cenario manifest (#560) (#584)

The manifest check added by #560 fails on 3.x.x
(tests/test_check_e2e_scenarios.py::test_the_checked_in_manifest_passes):
two live_regtest tests in the PR gated list are cited by no running
scenario. Both belong to existing #521 scenarios:

- pg_failover_tests::offer_standby::a_found_block_offered_after_the_standby_flush_survives_a_replication_cut_at_submitblock
  (#570, #529 item c) runs on the #521 scenario 3 failover fixture; its
  criteria gain the standby flush wait's claim.
- node_outage_tests::node_restarted_into_warmup_before_submitblock_lands_the_block_once
  (#566) is a #521 scenario 4 node-outage drill.

scripts/check_e2e_scenarios.py and its tests pass.

Refs #560, #570, #566.

Co-authored-by: Claude Opus 5.5 <[email protected]>
djh58 added a commit that referenced this pull request Sep 29, 2026
…abase answers, finish an offer in flight at shutdown, and record a recovered reservation's outcome as unknown (#529, #578) (#585)

* 3.x.x: retry a failed candidate attempt's claim release until the database answers, finish an offer in flight at shutdown, and record a recovered reservation's outcome as unknown (#529, #578)

A PostgreSQL failover while a found block is mid-landing delayed the landing
by up to the 120 s candidate lease (#529 item b). The offering frontend's
attempt failed on the old primary's dead connections, its claim release
failed on the same connections, and no frontend could take the row until the
lease expired.

The submit loop now keeps a failed attempt whose release did not reach the
database, and retries the same token- and lease-fenced release (the one
retry_candidate runs, split out as release_candidate_claim) about once a
second until the database answers or the lease's local end passes. At
shutdown it tries each once more through release_recovery_claim.

- Structural, not by convention: claim_release::Attempt owns the claim,
  the future of Attempt::run borrows it, and the only ways to release it
  (Attempt::failed, and at shutdown Attempt::hand_back_at_shutdown, which
  is #573's hand-back moved there unchanged: same release, reason, bound
  and logs) consume it, so the borrow checker drops the work first.
  Nothing this process started under the claim, submitblock included, can
  still run once the row is released.
- The release is fenced on the token and the live lease, so it changes
  nothing once another frontend has taken the row or the lease expired.
  Offer-state rows are never offered again by the recovery, as before.
- Retries keep their schedule while the loop processes other rows; before
  each claim the loop waits for at most one bounded retry (the lease's 5 s
  bound, never past the lease's local end).
- The lease's local end comes from the heartbeat itself (the start of the
  last successful renewal plus the lease), never later than the database's
  own expiry.
- WARN logs when a release is deferred and when it succeeds or expires.
- A holder that died with the old primary still leaves its claim to the
  lease. A takeover keyed on the promotion (a timeline-stamped claim) would
  cover it, but needs a migration and preempts every healthy holder after a
  promotion; it stays a documented option in #529.

A graceful shutdown between the offer reservation's commit and submitblock
dropped the attempt, leaving an offer_reserved row that was never sent and
that recovery never offers again, so a restart could lose a found block;
#570's standby wait sits inside that window (#578). The offer path now
holds an offer section from just before the reservation until the node's
answer is recorded or the unsent reservation is returned to pending. A
shutdown that finds one open keeps driving the attempt until it closes,
within the send's deadline, the standby wait's bound and the lease's bound
for the reservation and the recording, logs that it waits, and only then
stops; the landing after it is left to the next claim, which lands the
offered row without another offer. Pre-dispatch failures still return the
reservation through release_unsent_offer. A crash in the window is
unchanged: recovery reconciles the reservation as delivery unknown.

A recovered offer_reserved row whose call's answer was never recorded landed
submitted with offer_outcome NULL (#529 item a). finish_candidate now
records unknown for an offer-state row without an outcome, as the
reconciliation and orphan dispositions already do; pending rows keep none.

Tests (gated, listed in test/prism-gated-tests.txt):
- claim_release_tests, a third frontend reaching PostgreSQL through a TCP
  relay the test cuts and heals, with a 30 s lease: the claim is released
  0.3 s after the database answers and only after the attempt's work was
  dropped, then another frontend recovers the reservation and lands it with
  outcome unknown and no submitblock; a deferred release leaves a claim
  another frontend took after expiry untouched; shutdown releases a
  deferred claim.
- offer_shutdown_tests: a shutdown with the attempt parked right after the
  reservation (before the standby wait) or right before the send waits for
  the offer; the block is sent once, recorded accepted, and landed once.
- The live async failover drill now asserts landing within 30 s of the
  promotion (2.3 s here; 119.8 s with the retry removed) and the unknown
  outcome.

Docs: the ledger operations guide describes the deferred release, the
shutdown mid-offer and the recorded outcome, and the HA reference's
promotion step 5 says when a mid-landing block lands.

Closes #529. Closes #578.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* 3.x.x: bound the submit loop's shutdown by one 20 s budget, give the offer section the renewal's allowance, and classify the moved pool checkouts (#529, #578)

Review of #585 found two ways the shutdown path could run out of time.

- The offer-section bound allowed the lease's bound twice, for the
  reservation and the recording, but a section has three database steps:
  the strictly-live renewal before submitblock is the third. A slow but
  live database could end the wait during the send and drop a reserved
  block, the loss #578 prevents. It now allows the lease's bound three
  times.
- After the shutdown signal the loop could spend the section wait, the
  claim hand-back and one bounded attempt per deferred release in series,
  past the server's 30 s join of its tasks, which then aborts the loop and
  leaves its claims to the lease. Everything after the signal now shares
  one 20 s budget (SHUTDOWN_BUDGET), leaving room for one bounded retry
  already running when the signal came, and a signal that arrives during
  the pre-claim retry claims no new row.

scripts/prism_pool_acquires.json follows the moves: the heartbeat's
checkout is now in with_tracked_heartbeat, retry_candidate's BEGIN in
release_candidate_claim, and Attempt::run is classified non-database (a
name collision, like the server's runtime run), which the Python shard's
pool-acquire check requires.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant