Node state-transition model#263
Open
pinodeca wants to merge 2 commits into
Open
Conversation
Adds docs/node-state-model.md, a design proposal consolidating the node-status work for issues #240 (skipped downstream nodes) and #171 (race-loser nodes left running/pending). Defines instance and node lifecycle states, legal transitions, a coarse status set plus nullable status_reason, loop iteration-scoping/reset semantics, and prior-art alignment with Airflow/Temporal/BPMN/Step Functions. The #240 skipped-node work shipped earlier in PR #249; this PR (#263) defines the consolidated model and will add the remaining implementation (cancelled, status_reason, race-loser reconciliation, loop reset) after review. Design only; implementation to follow on this PR.
68283e0 to
44c171e
Compare
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.
Summary
Introduces a formal node & instance state-transition model for
pg_durable, then implements it. This consolidates two related node-status gaps:running/pendingafter aRACEresolves; they should reach a terminal state.skipped(initialskippedsupport landed in WIP: start issue #240 implementation for skipped downstream node status #249; this PR formalizes the model and itsstatus_reason).What's here now
The first commit adds the design proposal: docs/node-state-model.md. It defines:
pending,running,completed,failed,skipped,cancelled) plus a nullablestatus_reason(upstream_failed,branch_not_taken,race_lost,scope_cancelled) — avoiding an ever-growing enum under the strict schema-upgrade contract.THEN/IF/LOOP/JOIN/RACE/BREAK).df.nodesrow behaves acrosscontinue_as_new, and the body-subgraph reset that prevents stale terminal marks leaking between iterations.ContinueAsNew), BPMN 2.0 (withdrawn), and AWS Step Functions.pending → skippedterminal sweep) and df.instance_nodes leaves race-loser nodes running or pending after race completion #171 (running → cancelledsubtree reconciliation at race resolution).Plan
This PR starts as a design proposal for review. After incorporating colleague feedback, the implementation (status set additions,
status_reasoncolumn, race-loser reconciliation, and loop-reset) will land on this same PR.Upgrade & migration
The model is explicit about backward compatibility: new status/
status_reasonrequire install + upgrade DDL, and every reconciliation activity must no-op gracefully against schemas that predate the relevant column/status (the schema-probe pattern already used forskipped).