fix(runtime): make local operation state transactional and durable - #1136
Conversation
|
Fresh Sonar cleanup pushed in
The plain-language summary and |
|
Fresh Linux CI exposed and this update fixes one final WAL lifecycle race. SQLite may unlink an ephemeral Verification: 115 crash-consistency tests pass; the affected path module is 100% line/branch covered; the original four-process write test passed 10 consecutive runs; Ruff, repository policy, and diff hygiene pass. Fresh CI has restarted on this exact SHA. |
|
Fresh Sonar analyzed the WAL-race head and reported one maintainability issue: the path-admission helper crossed the configured complexity threshold by one. Commit 5981ebe extracts link-count admission into a focused helper without changing behavior or suppressing the rule. The full 115-test crash-consistency suite still passes, the path module remains 100% line/branch covered, and Ruff plus repository policy pass. Fresh CI/Sonar has restarted on this exact head. |
Closes #1092 and implements the durable local API-404 state boundary, including crash recovery, exclusive process ownership, legacy-store compatibility, and public snapshot alignment.
5981ebe to
a8e9641
Compare
a8e9641 to
1f7a014
Compare
|
@doublewhy Thank you for this, this raised some important architectural issues that haven't been grappled with. Issue moved to milestone 68 (Runtime Control-Plane) and is blocked on #1151 |
|
Review result: changes required before merge.
SQLite WAL, atomic idempotency claims, conservative interrupted-operation handling, and a profiled single-host durable provider remain a reasonable implementation direction. |
…successor # Conflicts: # docs/explain/sdl/runtime-architecture.md # docs/requirements/API-404/requirement.md # implementations/python/packages/raes_runtime/control_plane.py # implementations/python/packages/raes_runtime/control_plane_store.py # implementations/python/tests/test_runtime_control_plane_api.py
|
|
||
| try: | ||
| snapshot = self._store.load_snapshot() | ||
| operations = self._store.load_records() |
There was a problem hiding this comment.
[core] Reloaded non-terminal operations are never sealed after an uncertain commit
If a backend effect completes but the terminal store call raises before committing, the durable claim can remain ACCEPTED or RUNNING. _resynchronize_after_store_error reloads that record and leaves the runtime healthy without applying the interrupted-operation reconciliation policy. A same-key retry then returns the existing non-terminal receipt, and polling cannot progress until the process happens to restart. Route the reloaded records through reconcile_interrupted_operations before publishing them; if reconciliation itself fails, poison the runtime as for a failed reload.
Plain-language summary
Issue Tracking
Closes #1092
Part of #8.
What changes
runtime-snapshot-v1so the public contract matches the exhaustive durable snapshot codec.Current-base integration
This branch merges
devat5d2f738fb137760480a3ef9b2eae023f5df1c65bthrough merge commit2b19c4ac0ce387a6b805ea5cdbe06ae782eebe8f. The durability changes remain limited to the local control-plane store; inherited HTTP admission, offload, scheduler, and realization behavior comes from the current base.Scope boundary
This is a single-host, single-process local reference store. It does not claim distributed consensus, multi-worker cache coherence, durable job scheduling, backend-effect exactly-once guarantees, or request offload.
Verification
RAES_REQUIREMENT_UID=API-404 implementations/python/.venv/bin/python tools/verify_all.py: passed — 7,449 passed, 1 skipped, and 4 xfailed;