fix(coordinator): persist ready-barrier release even when the status read fails - #3117
fix(coordinator): persist ready-barrier release even when the status read fails#3117phil-opp wants to merge 1 commit into
Conversation
…read fails `broadcast_all_nodes_ready` flips the in-memory `ready_barrier_released` flag unconditionally (via `release_barrier_message`) but, on the failed-barrier path, only persisted the durable record when it could resolve a status. A `store.get_dataflow` error (or `Ok(None)`) skipped the entire write, leaving the flag `true` in memory but stale on disk. If the in-memory `RunningDataflow` is then destroyed (coordinator restart or orphan reclaim) before a later status-persist re-captures the flag, a daemon that was disconnected when the broadcast fired reconnects, reads `ready_barrier_released == false` from the stale record, is never replayed the release, and parks its nodes for the life of the dataflow -- exactly the #2998 reconnect-hang window that #3013 set out to close, on the store-I/O-trouble path where durability matters most. Decouple persisting the release + verdict from resolving the status: extract `persist_ready_barrier_release`, which always writes the record and only makes the *status* conditional. A failed barrier preserves the record's current status when it can be read and otherwise falls back to `Pending` (a non-promoting status the reconcile path can still advance), so it never promotes to `Running`. Adds regression tests covering the status-read-error and no-prior-record failed-barrier paths (release still persisted) and the successful-barrier path (still promoted to `Running`). Closes #3115 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PCXs8nkFNV7e4AhQLRVSSH
|
Merging to
After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here |
|
🤖 Automated review by Claude — this is a fully automated review with no human in the loop. Treat it as advisory. Reviewed the diff — no issues found. Decoupling the (now unconditional) durable record write from the (conditional) status resolution correctly closes the reconnect-hang window on the store-read-error path — previously a read error or Generated by Claude Code |
Summary
Fixes #3115.
broadcast_all_nodes_readyflips the in-memoryready_barrier_releasedflag unconditionally (viarelease_barrier_message) but, on the failed-barrier path, only persisted the durable record when it could resolve a status. Astore.get_dataflowerror (orOk(None)) skipped the entire write, leaving the flagtruein memory but stale on disk.If the in-memory
RunningDataflowis then destroyed (coordinator restart or orphan reclaim) before a later status-persist re-captures the flag, a daemon that was disconnected when the broadcast fired reconnects, readsready_barrier_released == falsefrom the stale record, is never replayed the release, and parks its nodes for the life of the dataflow — exactly the #2998 reconnect-hang window that #3013 set out to close, on the store-I/O-trouble path where durability matters most.Fix
Decouple persisting the release + verdict from resolving the status, as the issue suggested. Extract
persist_ready_barrier_release, which:ready_barrier_releasedflag +exited_before_subscribeverdict come frommake_record), andRunning; a failed barrier preserves the record's current status when it can be read, and otherwise falls back toPending— a non-promoting status the reconcile path can still advance — so it never promotes toRunning.The key property restored: a failed-barrier release leaves
record.ready_barrier_released == trueon disk even when the status read fails.Tests
New regression tests in
binaries/coordinator/src/lib.rs:failed_barrier_release_persists_when_status_read_fails— aFailingReadStorewhoseget_dataflowalways errors; asserts the release is still persisted (fails on the old code, which skipped the write).failed_barrier_release_persists_when_record_absent— theOk(None)companion path.successful_barrier_release_persists_running— confirms a successful barrier still promotes toRunning.Full
dora-coordinatorsuite passes (125 lib + 22 + 4);cargo fmt --checkandcargo clippy -- -D warningsclean.Generated by Claude Code