{ "scope": "SQLite local transactions and controlled process exits; finite 2PC abstract durable states", "cases": { "order-first": { "process": { "pid": 93760, "exit": 73 }, "state": { "orders": { "orders": [ [ "o1", "{\"account\":\"a1\",\"amount\":30,\"order\":\"o1\"}" ] ], "outbox": [] }, "broker": { "queue": [] }, "consumer": { "balance": [ [ 1, 100 ] ], "inbox": [], "actions": [] } } }, "message-first": { "process": { "pid": 93763, "exit": 73 }, "state": { "orders": { "orders": [], "outbox": [] }, "broker": { "queue": [ [ 1, "o1", "{\"account\":\"a1\",\"amount\":30,\"order\":\"o1\"}", 0 ] ] }, "consumer": { "balance": [ [ 1, 100 ] ], "inbox": [], "actions": [] } } }, "order-inserted": { "first": { "pid": 93767, "exit": 73 }, "recovery": { "pid": 93782, "exit": 0 }, "state": { "orders": { "orders": [ [ "o1", "{\"account\":\"a1\",\"amount\":30,\"order\":\"o1\"}" ] ], "outbox": [ [ "o1", "{\"account\":\"a1\",\"amount\":30,\"order\":\"o1\"}", 0 ] ] }, "broker": { "queue": [] }, "consumer": { "balance": [ [ 1, 100 ] ], "inbox": [], "actions": [] } } }, "outbox-inserted": { "first": { "pid": 93810, "exit": 73 }, "recovery": { "pid": 93831, "exit": 0 }, "state": { "orders": { "orders": [ [ "o1", "{\"account\":\"a1\",\"amount\":30,\"order\":\"o1\"}" ] ], "outbox": [ [ "o1", "{\"account\":\"a1\",\"amount\":30,\"order\":\"o1\"}", 0 ] ] }, "broker": { "queue": [] }, "consumer": { "balance": [ [ 1, 100 ] ], "inbox": [], "actions": [] } } }, "order-committed": { "first": { "pid": 93853, "exit": 73 }, "recovery": { "pid": 93874, "exit": 0 }, "state": { "orders": { "orders": [ [ "o1", "{\"account\":\"a1\",\"amount\":30,\"order\":\"o1\"}" ] ], "outbox": [ [ "o1", "{\"account\":\"a1\",\"amount\":30,\"order\":\"o1\"}", 0 ] ] }, "broker": { "queue": [] }, "consumer": { "balance": [ [ 1, 100 ] ], "inbox": [], "actions": [] } } }, "relay": { "first": { "pid": 93908, "exit": 73 }, "recovery": { "pid": 93914, "exit": 0 }, "state": { "orders": { "orders": [ [ "o1", "{\"account\":\"a1\",\"amount\":30,\"order\":\"o1\"}" ] ], "outbox": [ [ "o1", "{\"account\":\"a1\",\"amount\":30,\"order\":\"o1\"}", 1 ] ] }, "broker": { "queue": [ [ 1, "o1", "{\"account\":\"a1\",\"amount\":30,\"order\":\"o1\"}", 1 ], [ 2, "o1", "{\"account\":\"a1\",\"amount\":30,\"order\":\"o1\"}", 1 ], [ 3, "o1", "{\"account\":\"a1\",\"amount\":31,\"order\":\"o1\"}", 0 ] ] }, "consumer": { "balance": [ [ 1, 90 ] ], "inbox": [ [ "o1", "{\"account\":\"a1\",\"amount\":30,\"order\":\"o1\"}", 70 ] ], "actions": [ [ "unrelated-credit", 20, 90 ] ] } } }, "inbox-inserted": { "first": { "pid": 93916, "exit": 73 }, "recovery": { "pid": 93918, "exit": 0 }, "state": { "orders": { "orders": [], "outbox": [] }, "broker": { "queue": [ [ 1, "o1", "{\"account\":\"a1\",\"amount\":30,\"order\":\"o1\"}", 1 ] ] }, "consumer": { "balance": [ [ 1, 70 ] ], "inbox": [ [ "o1", "{\"account\":\"a1\",\"amount\":30,\"order\":\"o1\"}", 70 ] ], "actions": [] } } }, "effect-applied": { "first": { "pid": 93919, "exit": 73 }, "recovery": { "pid": 93960, "exit": 0 }, "state": { "orders": { "orders": [], "outbox": [] }, "broker": { "queue": [ [ 1, "o1", "{\"account\":\"a1\",\"amount\":30,\"order\":\"o1\"}", 1 ] ] }, "consumer": { "balance": [ [ 1, 70 ] ], "inbox": [ [ "o1", "{\"account\":\"a1\",\"amount\":30,\"order\":\"o1\"}", 70 ] ], "actions": [] } } }, "consumer-committed": { "first": { "pid": 94001, "exit": 73 }, "recovery": { "pid": 94022, "exit": 0 }, "state": { "orders": { "orders": [], "outbox": [] }, "broker": { "queue": [ [ 1, "o1", "{\"account\":\"a1\",\"amount\":30,\"order\":\"o1\"}", 1 ] ] }, "consumer": { "balance": [ [ 1, 70 ] ], "inbox": [ [ "o1", "{\"account\":\"a1\",\"amount\":30,\"order\":\"o1\"}", 70 ] ], "actions": [] } } }, "consume-inbox-first": { "first": { "pid": 94025, "exit": 73 }, "recovery": { "pid": 94053, "exit": 0 }, "state": { "orders": { "orders": [], "outbox": [] }, "broker": { "queue": [ [ 1, "o1", "{\"account\":\"a1\",\"amount\":30,\"order\":\"o1\"}", 1 ] ] }, "consumer": { "balance": [ [ 1, 100 ] ], "inbox": [ [ "o1", "{\"account\":\"a1\",\"amount\":30,\"order\":\"o1\"}", 70 ] ], "actions": [] } } }, "consume-effect-first": { "first": { "pid": 94055, "exit": 73 }, "recovery": { "pid": 94057, "exit": 0 }, "state": { "orders": { "orders": [], "outbox": [] }, "broker": { "queue": [ [ 1, "o1", "{\"account\":\"a1\",\"amount\":30,\"order\":\"o1\"}", 1 ] ] }, "consumer": { "balance": [ [ 1, 40 ] ], "inbox": [ [ "o1", "{\"account\":\"a1\",\"amount\":30,\"order\":\"o1\"}", 40 ] ], "actions": [] } } }, "saga": { "orders": { "orders": [], "outbox": [] }, "broker": { "queue": [] }, "consumer": { "balance": [ [ 1, 120 ] ], "inbox": [], "actions": [ [ "compensate-saga-debit", 30, 120 ], [ "other-credit", 20, 90 ], [ "saga-debit", -30, 70 ] ] } }, "saga-wrong": { "orders": { "orders": [], "outbox": [] }, "broker": { "queue": [] }, "consumer": { "balance": [ [ 1, 100 ] ], "inbox": [], "actions": [ [ "other-credit", 20, 90 ], [ "saga-debit", -30, 70 ] ] } } }, "two_phase": { "COMMIT": { "trace": [ { "action": "save-participant-state", "participant": "P", "state": "PREPARED" }, { "action": "send-vote", "participant": "P", "vote": "YES" }, { "action": "save-participant-state", "participant": "Q", "state": "PREPARED" }, { "action": "send-vote", "participant": "Q", "vote": "YES" }, { "action": "coordinator-record-decision", "decision": "COMMIT" }, { "action": "deliver-decision", "participant": "Q", "decision": "COMMIT" } ], "p_view": { "state": "PREPARED", "own_vote": "YES", "decision_received": null }, "states": { "P": "PREPARED", "Q": "COMMITTED" }, "normal_action": "WAIT", "timeout_mutation": { "P": "ABORTED", "Q": "COMMITTED" } }, "ABORT": { "trace": [ { "action": "save-participant-state", "participant": "P", "state": "PREPARED" }, { "action": "send-vote", "participant": "P", "vote": "YES" }, { "action": "save-participant-state", "participant": "Q", "state": "ABORTED" }, { "action": "send-vote", "participant": "Q", "vote": "NO" }, { "action": "coordinator-record-decision", "decision": "ABORT" }, { "action": "deliver-decision", "participant": "Q", "decision": "ABORT" } ], "p_view": { "state": "PREPARED", "own_vote": "YES", "decision_received": null }, "states": { "P": "PREPARED", "Q": "ABORTED" }, "normal_action": "WAIT", "timeout_mutation": { "P": "COMMITTED", "Q": "ABORTED" } } }, "raw_events": { "consume-effect-first": [ { "kind": "initialized", "pid": 93712, "pragmas": { "journal_mode": "delete", "synchronous": 2, "temp_store": 2 }, "python": "3.14.4 (main, Apr 7 2026, 13:13:20) [Clang 21.0.0 (clang-2100.0.123.102)]", "sqlite": "3.51.3" }, { "delivery": 1, "event_id": "o1", "kind": "broker-accepted", "payload": "{\"account\":\"a1\",\"amount\":30,\"order\":\"o1\"}", "pid": 93712 }, { "cut": "effect-only-committed", "kind": "worker-start", "mode": "consume-effect-first", "pid": 94055 }, { "kind": "stage", "pid": 94055, "stage": "effect-only-committed" }, { "code": 73, "kind": "controlled-exit", "pid": 94055, "stage": "effect-only-committed" }, { "code": 73, "kind": "worker-exit", "pid": 93712, "worker_pid": 94055 }, { "cut": null, "kind": "worker-start", "mode": "consume", "pid": 94057 }, { "kind": "stage", "pid": 94057, "stage": "inbox-inserted" }, { "kind": "stage", "pid": 94057, "stage": "effect-applied" }, { "kind": "stage", "pid": 94057, "stage": "consumer-committed" }, { "event_id": "o1", "kind": "consumer-result", "pid": 94057, "result": 40 }, { "code": 0, "kind": "worker-exit", "pid": 93712, "worker_pid": 94057 }, { "kind": "independent-query", "pid": 93712, "state": { "broker": { "queue": [ [ 1, "o1", "{\"account\":\"a1\",\"amount\":30,\"order\":\"o1\"}", 1 ] ] }, "consumer": { "actions": [], "balance": [ [ 1, 40 ] ], "inbox": [ [ "o1", "{\"account\":\"a1\",\"amount\":30,\"order\":\"o1\"}", 40 ] ] }, "orders": { "orders": [], "outbox": [] } } } ], "consume-inbox-first": [ { "kind": "initialized", "pid": 93712, "pragmas": { "journal_mode": "delete", "synchronous": 2, "temp_store": 2 }, "python": "3.14.4 (main, Apr 7 2026, 13:13:20) [Clang 21.0.0 (clang-2100.0.123.102)]", "sqlite": "3.51.3" }, { "delivery": 1, "event_id": "o1", "kind": "broker-accepted", "payload": "{\"account\":\"a1\",\"amount\":30,\"order\":\"o1\"}", "pid": 93712 }, { "cut": "inbox-only-committed", "kind": "worker-start", "mode": "consume-inbox-first", "pid": 94025 }, { "kind": "stage", "pid": 94025, "stage": "inbox-only-committed" }, { "code": 73, "kind": "controlled-exit", "pid": 94025, "stage": "inbox-only-committed" }, { "code": 73, "kind": "worker-exit", "pid": 93712, "worker_pid": 94025 }, { "cut": null, "kind": "worker-start", "mode": "consume", "pid": 94053 }, { "kind": "stage", "pid": 94053, "stage": "consumer-committed" }, { "event_id": "o1", "kind": "consumer-result", "pid": 94053, "result": 70 }, { "code": 0, "kind": "worker-exit", "pid": 93712, "worker_pid": 94053 }, { "kind": "independent-query", "pid": 93712, "state": { "broker": { "queue": [ [ 1, "o1", "{\"account\":\"a1\",\"amount\":30,\"order\":\"o1\"}", 1 ] ] }, "consumer": { "actions": [], "balance": [ [ 1, 100 ] ], "inbox": [ [ "o1", "{\"account\":\"a1\",\"amount\":30,\"order\":\"o1\"}", 70 ] ] }, "orders": { "orders": [], "outbox": [] } } } ], "consumer-committed": [ { "kind": "initialized", "pid": 93712, "pragmas": { "journal_mode": "delete", "synchronous": 2, "temp_store": 2 }, "python": "3.14.4 (main, Apr 7 2026, 13:13:20) [Clang 21.0.0 (clang-2100.0.123.102)]", "sqlite": "3.51.3" }, { "delivery": 1, "event_id": "o1", "kind": "broker-accepted", "payload": "{\"account\":\"a1\",\"amount\":30,\"order\":\"o1\"}", "pid": 93712 }, { "cut": "consumer-committed", "kind": "worker-start", "mode": "consume", "pid": 94001 }, { "kind": "stage", "pid": 94001, "stage": "inbox-inserted" }, { "kind": "stage", "pid": 94001, "stage": "effect-applied" }, { "kind": "stage", "pid": 94001, "stage": "consumer-committed" }, { "code": 73, "kind": "controlled-exit", "pid": 94001, "stage": "consumer-committed" }, { "code": 73, "kind": "worker-exit", "pid": 93712, "worker_pid": 94001 }, { "kind": "independent-query", "pid": 93712, "state": { "broker": { "queue": [ [ 1, "o1", "{\"account\":\"a1\",\"amount\":30,\"order\":\"o1\"}", 0 ] ] }, "consumer": { "actions": [], "balance": [ [ 1, 70 ] ], "inbox": [ [ "o1", "{\"account\":\"a1\",\"amount\":30,\"order\":\"o1\"}", 70 ] ] }, "orders": { "orders": [], "outbox": [] } } }, { "cut": null, "kind": "worker-start", "mode": "consume", "pid": 94022 }, { "kind": "stage", "pid": 94022, "stage": "consumer-committed" }, { "event_id": "o1", "kind": "consumer-result", "pid": 94022, "result": 70 }, { "code": 0, "kind": "worker-exit", "pid": 93712, "worker_pid": 94022 }, { "kind": "independent-query", "pid": 93712, "state": { "broker": { "queue": [ [ 1, "o1", "{\"account\":\"a1\",\"amount\":30,\"order\":\"o1\"}", 1 ] ] }, "consumer": { "actions": [], "balance": [ [ 1, 70 ] ], "inbox": [ [ "o1", "{\"account\":\"a1\",\"amount\":30,\"order\":\"o1\"}", 70 ] ] }, "orders": { "orders": [], "outbox": [] } } }, { "kind": "independent-query", "pid": 93712, "state": { "broker": { "queue": [ [ 1, "o1", "{\"account\":\"a1\",\"amount\":30,\"order\":\"o1\"}", 1 ] ] }, "consumer": { "actions": [], "balance": [ [ 1, 70 ] ], "inbox": [ [ "o1", "{\"account\":\"a1\",\"amount\":30,\"order\":\"o1\"}", 70 ] ] }, "orders": { "orders": [], "outbox": [] } } } ], "effect-applied": [ { "kind": "initialized", "pid": 93712, "pragmas": { "journal_mode": "delete", "synchronous": 2, "temp_store": 2 }, "python": "3.14.4 (main, Apr 7 2026, 13:13:20) [Clang 21.0.0 (clang-2100.0.123.102)]", "sqlite": "3.51.3" }, { "delivery": 1, "event_id": "o1", "kind": "broker-accepted", "payload": "{\"account\":\"a1\",\"amount\":30,\"order\":\"o1\"}", "pid": 93712 }, { "cut": "effect-applied", "kind": "worker-start", "mode": "consume", "pid": 93919 }, { "kind": "stage", "pid": 93919, "stage": "inbox-inserted" }, { "kind": "stage", "pid": 93919, "stage": "effect-applied" }, { "code": 73, "kind": "controlled-exit", "pid": 93919, "stage": "effect-applied" }, { "code": 73, "kind": "worker-exit", "pid": 93712, "worker_pid": 93919 }, { "kind": "independent-query", "pid": 93712, "state": { "broker": { "queue": [ [ 1, "o1", "{\"account\":\"a1\",\"amount\":30,\"order\":\"o1\"}", 0 ] ] }, "consumer": { "actions": [], "balance": [ [ 1, 100 ] ], "inbox": [] }, "orders": { "orders": [], "outbox": [] } } }, { "cut": null, "kind": "worker-start", "mode": "consume", "pid": 93960 }, { "kind": "stage", "pid": 93960, "stage": "inbox-inserted" }, { "kind": "stage", "pid": 93960, "stage": "effect-applied" }, { "kind": "stage", "pid": 93960, "stage": "consumer-committed" }, { "event_id": "o1", "kind": "consumer-result", "pid": 93960, "result": 70 }, { "code": 0, "kind": "worker-exit", "pid": 93712, "worker_pid": 93960 }, { "kind": "independent-query", "pid": 93712, "state": { "broker": { "queue": [ [ 1, "o1", "{\"account\":\"a1\",\"amount\":30,\"order\":\"o1\"}", 1 ] ] }, "consumer": { "actions": [], "balance": [ [ 1, 70 ] ], "inbox": [ [ "o1", "{\"account\":\"a1\",\"amount\":30,\"order\":\"o1\"}", 70 ] ] }, "orders": { "orders": [], "outbox": [] } } }, { "kind": "independent-query", "pid": 93712, "state": { "broker": { "queue": [ [ 1, "o1", "{\"account\":\"a1\",\"amount\":30,\"order\":\"o1\"}", 1 ] ] }, "consumer": { "actions": [], "balance": [ [ 1, 70 ] ], "inbox": [ [ "o1", "{\"account\":\"a1\",\"amount\":30,\"order\":\"o1\"}", 70 ] ] }, "orders": { "orders": [], "outbox": [] } } } ], "inbox-inserted": [ { "kind": "initialized", "pid": 93712, "pragmas": { "journal_mode": "delete", "synchronous": 2, "temp_store": 2 }, "python": "3.14.4 (main, Apr 7 2026, 13:13:20) [Clang 21.0.0 (clang-2100.0.123.102)]", "sqlite": "3.51.3" }, { "delivery": 1, "event_id": "o1", "kind": "broker-accepted", "payload": "{\"account\":\"a1\",\"amount\":30,\"order\":\"o1\"}", "pid": 93712 }, { "cut": "inbox-inserted", "kind": "worker-start", "mode": "consume", "pid": 93916 }, { "kind": "stage", "pid": 93916, "stage": "inbox-inserted" }, { "code": 73, "kind": "controlled-exit", "pid": 93916, "stage": "inbox-inserted" }, { "code": 73, "kind": "worker-exit", "pid": 93712, "worker_pid": 93916 }, { "kind": "independent-query", "pid": 93712, "state": { "broker": { "queue": [ [ 1, "o1", "{\"account\":\"a1\",\"amount\":30,\"order\":\"o1\"}", 0 ] ] }, "consumer": { "actions": [], "balance": [ [ 1, 100 ] ], "inbox": [] }, "orders": { "orders": [], "outbox": [] } } }, { "cut": null, "kind": "worker-start", "mode": "consume", "pid": 93918 }, { "kind": "stage", "pid": 93918, "stage": "inbox-inserted" }, { "kind": "stage", "pid": 93918, "stage": "effect-applied" }, { "kind": "stage", "pid": 93918, "stage": "consumer-committed" }, { "event_id": "o1", "kind": "consumer-result", "pid": 93918, "result": 70 }, { "code": 0, "kind": "worker-exit", "pid": 93712, "worker_pid": 93918 }, { "kind": "independent-query", "pid": 93712, "state": { "broker": { "queue": [ [ 1, "o1", "{\"account\":\"a1\",\"amount\":30,\"order\":\"o1\"}", 1 ] ] }, "consumer": { "actions": [], "balance": [ [ 1, 70 ] ], "inbox": [ [ "o1", "{\"account\":\"a1\",\"amount\":30,\"order\":\"o1\"}", 70 ] ] }, "orders": { "orders": [], "outbox": [] } } }, { "kind": "independent-query", "pid": 93712, "state": { "broker": { "queue": [ [ 1, "o1", "{\"account\":\"a1\",\"amount\":30,\"order\":\"o1\"}", 1 ] ] }, "consumer": { "actions": [], "balance": [ [ 1, 70 ] ], "inbox": [ [ "o1", "{\"account\":\"a1\",\"amount\":30,\"order\":\"o1\"}", 70 ] ] }, "orders": { "orders": [], "outbox": [] } } } ], "message-first": [ { "kind": "initialized", "pid": 93712, "pragmas": { "journal_mode": "delete", "synchronous": 2, "temp_store": 2 }, "python": "3.14.4 (main, Apr 7 2026, 13:13:20) [Clang 21.0.0 (clang-2100.0.123.102)]", "sqlite": "3.51.3" }, { "cut": "bare-message-committed", "kind": "worker-start", "mode": "message-first", "pid": 93763 }, { "delivery": 1, "event_id": "o1", "kind": "broker-accepted", "payload": "{\"account\":\"a1\",\"amount\":30,\"order\":\"o1\"}", "pid": 93763 }, { "kind": "stage", "pid": 93763, "stage": "bare-message-committed" }, { "code": 73, "kind": "controlled-exit", "pid": 93763, "stage": "bare-message-committed" }, { "code": 73, "kind": "worker-exit", "pid": 93712, "worker_pid": 93763 }, { "kind": "independent-query", "pid": 93712, "state": { "broker": { "queue": [ [ 1, "o1", "{\"account\":\"a1\",\"amount\":30,\"order\":\"o1\"}", 0 ] ] }, "consumer": { "actions": [], "balance": [ [ 1, 100 ] ], "inbox": [] }, "orders": { "orders": [], "outbox": [] } } } ], "order-committed": [ { "kind": "initialized", "pid": 93712, "pragmas": { "journal_mode": "delete", "synchronous": 2, "temp_store": 2 }, "python": "3.14.4 (main, Apr 7 2026, 13:13:20) [Clang 21.0.0 (clang-2100.0.123.102)]", "sqlite": "3.51.3" }, { "cut": "order-committed", "kind": "worker-start", "mode": "order", "pid": 93853 }, { "kind": "stage", "pid": 93853, "stage": "order-inserted" }, { "kind": "stage", "pid": 93853, "stage": "outbox-inserted" }, { "kind": "stage", "pid": 93853, "stage": "order-committed" }, { "code": 73, "kind": "controlled-exit", "pid": 93853, "stage": "order-committed" }, { "code": 73, "kind": "worker-exit", "pid": 93712, "worker_pid": 93853 }, { "kind": "independent-query", "pid": 93712, "state": { "broker": { "queue": [] }, "consumer": { "actions": [], "balance": [ [ 1, 100 ] ], "inbox": [] }, "orders": { "orders": [ [ "o1", "{\"account\":\"a1\",\"amount\":30,\"order\":\"o1\"}" ] ], "outbox": [ [ "o1", "{\"account\":\"a1\",\"amount\":30,\"order\":\"o1\"}", 0 ] ] } } }, { "cut": null, "kind": "worker-start", "mode": "order", "pid": 93874 }, { "kind": "order-retry", "payload": { "account": "a1", "amount": 30, "order": "o1" }, "pid": 93874 }, { "code": 0, "kind": "worker-exit", "pid": 93712, "worker_pid": 93874 }, { "kind": "order-retry", "payload": { "account": "a1", "amount": 30, "order": "o1" }, "pid": 93712 }, { "kind": "independent-query", "pid": 93712, "state": { "broker": { "queue": [] }, "consumer": { "actions": [], "balance": [ [ 1, 100 ] ], "inbox": [] }, "orders": { "orders": [ [ "o1", "{\"account\":\"a1\",\"amount\":30,\"order\":\"o1\"}" ] ], "outbox": [ [ "o1", "{\"account\":\"a1\",\"amount\":30,\"order\":\"o1\"}", 0 ] ] } } }, { "kind": "independent-query", "pid": 93712, "state": { "broker": { "queue": [] }, "consumer": { "actions": [], "balance": [ [ 1, 100 ] ], "inbox": [] }, "orders": { "orders": [ [ "o1", "{\"account\":\"a1\",\"amount\":30,\"order\":\"o1\"}" ] ], "outbox": [ [ "o1", "{\"account\":\"a1\",\"amount\":30,\"order\":\"o1\"}", 0 ] ] } } }, { "kind": "independent-query", "pid": 93712, "state": { "broker": { "queue": [] }, "consumer": { "actions": [], "balance": [ [ 1, 100 ] ], "inbox": [] }, "orders": { "orders": [ [ "o1", "{\"account\":\"a1\",\"amount\":30,\"order\":\"o1\"}" ] ], "outbox": [ [ "o1", "{\"account\":\"a1\",\"amount\":30,\"order\":\"o1\"}", 0 ] ] } } } ], "order-first": [ { "kind": "initialized", "pid": 93712, "pragmas": { "journal_mode": "delete", "synchronous": 2, "temp_store": 2 }, "python": "3.14.4 (main, Apr 7 2026, 13:13:20) [Clang 21.0.0 (clang-2100.0.123.102)]", "sqlite": "3.51.3" }, { "cut": "bare-order-committed", "kind": "worker-start", "mode": "order-first", "pid": 93760 }, { "kind": "stage", "pid": 93760, "stage": "bare-order-committed" }, { "code": 73, "kind": "controlled-exit", "pid": 93760, "stage": "bare-order-committed" }, { "code": 73, "kind": "worker-exit", "pid": 93712, "worker_pid": 93760 }, { "kind": "independent-query", "pid": 93712, "state": { "broker": { "queue": [] }, "consumer": { "actions": [], "balance": [ [ 1, 100 ] ], "inbox": [] }, "orders": { "orders": [ [ "o1", "{\"account\":\"a1\",\"amount\":30,\"order\":\"o1\"}" ] ], "outbox": [] } } } ], "order-inserted": [ { "kind": "initialized", "pid": 93712, "pragmas": { "journal_mode": "delete", "synchronous": 2, "temp_store": 2 }, "python": "3.14.4 (main, Apr 7 2026, 13:13:20) [Clang 21.0.0 (clang-2100.0.123.102)]", "sqlite": "3.51.3" }, { "cut": "order-inserted", "kind": "worker-start", "mode": "order", "pid": 93767 }, { "kind": "stage", "pid": 93767, "stage": "order-inserted" }, { "code": 73, "kind": "controlled-exit", "pid": 93767, "stage": "order-inserted" }, { "code": 73, "kind": "worker-exit", "pid": 93712, "worker_pid": 93767 }, { "kind": "independent-query", "pid": 93712, "state": { "broker": { "queue": [] }, "consumer": { "actions": [], "balance": [ [ 1, 100 ] ], "inbox": [] }, "orders": { "orders": [], "outbox": [] } } }, { "cut": null, "kind": "worker-start", "mode": "order", "pid": 93782 }, { "kind": "stage", "pid": 93782, "stage": "order-inserted" }, { "kind": "stage", "pid": 93782, "stage": "outbox-inserted" }, { "kind": "stage", "pid": 93782, "stage": "order-committed" }, { "code": 0, "kind": "worker-exit", "pid": 93712, "worker_pid": 93782 }, { "kind": "order-retry", "payload": { "account": "a1", "amount": 30, "order": "o1" }, "pid": 93712 }, { "kind": "independent-query", "pid": 93712, "state": { "broker": { "queue": [] }, "consumer": { "actions": [], "balance": [ [ 1, 100 ] ], "inbox": [] }, "orders": { "orders": [ [ "o1", "{\"account\":\"a1\",\"amount\":30,\"order\":\"o1\"}" ] ], "outbox": [ [ "o1", "{\"account\":\"a1\",\"amount\":30,\"order\":\"o1\"}", 0 ] ] } } }, { "kind": "independent-query", "pid": 93712, "state": { "broker": { "queue": [] }, "consumer": { "actions": [], "balance": [ [ 1, 100 ] ], "inbox": [] }, "orders": { "orders": [ [ "o1", "{\"account\":\"a1\",\"amount\":30,\"order\":\"o1\"}" ] ], "outbox": [ [ "o1", "{\"account\":\"a1\",\"amount\":30,\"order\":\"o1\"}", 0 ] ] } } }, { "kind": "independent-query", "pid": 93712, "state": { "broker": { "queue": [] }, "consumer": { "actions": [], "balance": [ [ 1, 100 ] ], "inbox": [] }, "orders": { "orders": [ [ "o1", "{\"account\":\"a1\",\"amount\":30,\"order\":\"o1\"}" ] ], "outbox": [ [ "o1", "{\"account\":\"a1\",\"amount\":30,\"order\":\"o1\"}", 0 ] ] } } } ], "outbox-inserted": [ { "kind": "initialized", "pid": 93712, "pragmas": { "journal_mode": "delete", "synchronous": 2, "temp_store": 2 }, "python": "3.14.4 (main, Apr 7 2026, 13:13:20) [Clang 21.0.0 (clang-2100.0.123.102)]", "sqlite": "3.51.3" }, { "cut": "outbox-inserted", "kind": "worker-start", "mode": "order", "pid": 93810 }, { "kind": "stage", "pid": 93810, "stage": "order-inserted" }, { "kind": "stage", "pid": 93810, "stage": "outbox-inserted" }, { "code": 73, "kind": "controlled-exit", "pid": 93810, "stage": "outbox-inserted" }, { "code": 73, "kind": "worker-exit", "pid": 93712, "worker_pid": 93810 }, { "kind": "independent-query", "pid": 93712, "state": { "broker": { "queue": [] }, "consumer": { "actions": [], "balance": [ [ 1, 100 ] ], "inbox": [] }, "orders": { "orders": [], "outbox": [] } } }, { "cut": null, "kind": "worker-start", "mode": "order", "pid": 93831 }, { "kind": "stage", "pid": 93831, "stage": "order-inserted" }, { "kind": "stage", "pid": 93831, "stage": "outbox-inserted" }, { "kind": "stage", "pid": 93831, "stage": "order-committed" }, { "code": 0, "kind": "worker-exit", "pid": 93712, "worker_pid": 93831 }, { "kind": "order-retry", "payload": { "account": "a1", "amount": 30, "order": "o1" }, "pid": 93712 }, { "kind": "independent-query", "pid": 93712, "state": { "broker": { "queue": [] }, "consumer": { "actions": [], "balance": [ [ 1, 100 ] ], "inbox": [] }, "orders": { "orders": [ [ "o1", "{\"account\":\"a1\",\"amount\":30,\"order\":\"o1\"}" ] ], "outbox": [ [ "o1", "{\"account\":\"a1\",\"amount\":30,\"order\":\"o1\"}", 0 ] ] } } }, { "kind": "independent-query", "pid": 93712, "state": { "broker": { "queue": [] }, "consumer": { "actions": [], "balance": [ [ 1, 100 ] ], "inbox": [] }, "orders": { "orders": [ [ "o1", "{\"account\":\"a1\",\"amount\":30,\"order\":\"o1\"}" ] ], "outbox": [ [ "o1", "{\"account\":\"a1\",\"amount\":30,\"order\":\"o1\"}", 0 ] ] } } }, { "kind": "independent-query", "pid": 93712, "state": { "broker": { "queue": [] }, "consumer": { "actions": [], "balance": [ [ 1, 100 ] ], "inbox": [] }, "orders": { "orders": [ [ "o1", "{\"account\":\"a1\",\"amount\":30,\"order\":\"o1\"}" ] ], "outbox": [ [ "o1", "{\"account\":\"a1\",\"amount\":30,\"order\":\"o1\"}", 0 ] ] } } } ], "relay": [ { "kind": "initialized", "pid": 93712, "pragmas": { "journal_mode": "delete", "synchronous": 2, "temp_store": 2 }, "python": "3.14.4 (main, Apr 7 2026, 13:13:20) [Clang 21.0.0 (clang-2100.0.123.102)]", "sqlite": "3.51.3" }, { "kind": "stage", "pid": 93712, "stage": "order-inserted" }, { "kind": "stage", "pid": 93712, "stage": "outbox-inserted" }, { "kind": "stage", "pid": 93712, "stage": "order-committed" }, { "cut": "published-before-mark", "kind": "worker-start", "mode": "relay", "pid": 93908 }, { "delivery": 1, "event_id": "o1", "kind": "broker-accepted", "payload": "{\"account\":\"a1\",\"amount\":30,\"order\":\"o1\"}", "pid": 93908 }, { "kind": "stage", "pid": 93908, "stage": "published-before-mark" }, { "code": 73, "kind": "controlled-exit", "pid": 93908, "stage": "published-before-mark" }, { "code": 73, "kind": "worker-exit", "pid": 93712, "worker_pid": 93908 }, { "cut": null, "kind": "worker-start", "mode": "relay", "pid": 93914 }, { "delivery": 2, "event_id": "o1", "kind": "broker-accepted", "payload": "{\"account\":\"a1\",\"amount\":30,\"order\":\"o1\"}", "pid": 93914 }, { "kind": "stage", "pid": 93914, "stage": "published-before-mark" }, { "kind": "relay-finished", "pid": 93914 }, { "code": 0, "kind": "worker-exit", "pid": 93712, "worker_pid": 93914 }, { "kind": "independent-query", "pid": 93712, "state": { "broker": { "queue": [ [ 1, "o1", "{\"account\":\"a1\",\"amount\":30,\"order\":\"o1\"}", 0 ], [ 2, "o1", "{\"account\":\"a1\",\"amount\":30,\"order\":\"o1\"}", 0 ] ] }, "consumer": { "actions": [], "balance": [ [ 1, 100 ] ], "inbox": [] }, "orders": { "orders": [ [ "o1", "{\"account\":\"a1\",\"amount\":30,\"order\":\"o1\"}" ] ], "outbox": [ [ "o1", "{\"account\":\"a1\",\"amount\":30,\"order\":\"o1\"}", 1 ] ] } } }, { "kind": "stage", "pid": 93712, "stage": "inbox-inserted" }, { "kind": "stage", "pid": 93712, "stage": "effect-applied" }, { "kind": "stage", "pid": 93712, "stage": "consumer-committed" }, { "event_id": "o1", "kind": "consumer-result", "pid": 93712, "result": 70 }, { "action_id": "unrelated-credit", "delta": 20, "kind": "action", "pid": 93712, "result": 90 }, { "kind": "stage", "pid": 93712, "stage": "consumer-committed" }, { "event_id": "o1", "kind": "consumer-result", "pid": 93712, "result": 70 }, { "kind": "independent-query", "pid": 93712, "state": { "broker": { "queue": [ [ 1, "o1", "{\"account\":\"a1\",\"amount\":30,\"order\":\"o1\"}", 1 ], [ 2, "o1", "{\"account\":\"a1\",\"amount\":30,\"order\":\"o1\"}", 1 ] ] }, "consumer": { "actions": [ [ "unrelated-credit", 20, 90 ] ], "balance": [ [ 1, 90 ] ], "inbox": [ [ "o1", "{\"account\":\"a1\",\"amount\":30,\"order\":\"o1\"}", 70 ] ] }, "orders": { "orders": [ [ "o1", "{\"account\":\"a1\",\"amount\":30,\"order\":\"o1\"}" ] ], "outbox": [ [ "o1", "{\"account\":\"a1\",\"amount\":30,\"order\":\"o1\"}", 1 ] ] } } }, { "delivery": 3, "event_id": "o1", "kind": "broker-accepted", "payload": "{\"account\":\"a1\",\"amount\":31,\"order\":\"o1\"}", "pid": 93712 }, { "kind": "independent-query", "pid": 93712, "state": { "broker": { "queue": [ [ 1, "o1", "{\"account\":\"a1\",\"amount\":30,\"order\":\"o1\"}", 1 ], [ 2, "o1", "{\"account\":\"a1\",\"amount\":30,\"order\":\"o1\"}", 1 ], [ 3, "o1", "{\"account\":\"a1\",\"amount\":31,\"order\":\"o1\"}", 0 ] ] }, "consumer": { "actions": [ [ "unrelated-credit", 20, 90 ] ], "balance": [ [ 1, 90 ] ], "inbox": [ [ "o1", "{\"account\":\"a1\",\"amount\":30,\"order\":\"o1\"}", 70 ] ] }, "orders": { "orders": [ [ "o1", "{\"account\":\"a1\",\"amount\":30,\"order\":\"o1\"}" ] ], "outbox": [ [ "o1", "{\"account\":\"a1\",\"amount\":30,\"order\":\"o1\"}", 1 ] ] } } }, { "kind": "independent-query", "pid": 93712, "state": { "broker": { "queue": [ [ 1, "o1", "{\"account\":\"a1\",\"amount\":30,\"order\":\"o1\"}", 1 ], [ 2, "o1", "{\"account\":\"a1\",\"amount\":30,\"order\":\"o1\"}", 1 ], [ 3, "o1", "{\"account\":\"a1\",\"amount\":31,\"order\":\"o1\"}", 0 ] ] }, "consumer": { "actions": [ [ "unrelated-credit", 20, 90 ] ], "balance": [ [ 1, 90 ] ], "inbox": [ [ "o1", "{\"account\":\"a1\",\"amount\":30,\"order\":\"o1\"}", 70 ] ] }, "orders": { "orders": [ [ "o1", "{\"account\":\"a1\",\"amount\":30,\"order\":\"o1\"}" ] ], "outbox": [ [ "o1", "{\"account\":\"a1\",\"amount\":30,\"order\":\"o1\"}", 1 ] ] } } }, { "kind": "independent-query", "pid": 93712, "state": { "broker": { "queue": [ [ 1, "o1", "{\"account\":\"a1\",\"amount\":30,\"order\":\"o1\"}", 1 ], [ 2, "o1", "{\"account\":\"a1\",\"amount\":30,\"order\":\"o1\"}", 1 ], [ 3, "o1", "{\"account\":\"a1\",\"amount\":31,\"order\":\"o1\"}", 0 ] ] }, "consumer": { "actions": [ [ "unrelated-credit", 20, 90 ] ], "balance": [ [ 1, 90 ] ], "inbox": [ [ "o1", "{\"account\":\"a1\",\"amount\":30,\"order\":\"o1\"}", 70 ] ] }, "orders": { "orders": [ [ "o1", "{\"account\":\"a1\",\"amount\":30,\"order\":\"o1\"}" ] ], "outbox": [ [ "o1", "{\"account\":\"a1\",\"amount\":30,\"order\":\"o1\"}", 1 ] ] } } } ], "saga": [ { "kind": "initialized", "pid": 93712, "pragmas": { "journal_mode": "delete", "synchronous": 2, "temp_store": 2 }, "python": "3.14.4 (main, Apr 7 2026, 13:13:20) [Clang 21.0.0 (clang-2100.0.123.102)]", "sqlite": "3.51.3" }, { "action_id": "saga-debit", "delta": -30, "kind": "action", "pid": 93712, "result": 70 }, { "action_id": "other-credit", "delta": 20, "kind": "action", "pid": 93712, "result": 90 }, { "action_id": "compensate-saga-debit", "delta": 30, "kind": "action", "pid": 93712, "result": 120 }, { "kind": "independent-query", "pid": 93712, "state": { "broker": { "queue": [] }, "consumer": { "actions": [ [ "compensate-saga-debit", 30, 120 ], [ "other-credit", 20, 90 ], [ "saga-debit", -30, 70 ] ], "balance": [ [ 1, 120 ] ], "inbox": [] }, "orders": { "orders": [], "outbox": [] } } } ], "saga-wrong": [ { "kind": "initialized", "pid": 93712, "pragmas": { "journal_mode": "delete", "synchronous": 2, "temp_store": 2 }, "python": "3.14.4 (main, Apr 7 2026, 13:13:20) [Clang 21.0.0 (clang-2100.0.123.102)]", "sqlite": "3.51.3" }, { "action_id": "saga-debit", "delta": -30, "kind": "action", "pid": 93712, "result": 70 }, { "action_id": "other-credit", "delta": 20, "kind": "action", "pid": 93712, "result": 90 }, { "kind": "independent-query", "pid": 93712, "state": { "broker": { "queue": [] }, "consumer": { "actions": [ [ "other-credit", 20, 90 ], [ "saga-debit", -30, 70 ] ], "balance": [ [ 1, 100 ] ], "inbox": [] }, "orders": { "orders": [], "outbox": [] } } }, { "kind": "independent-query", "pid": 93712, "state": { "broker": { "queue": [] }, "consumer": { "actions": [ [ "other-credit", 20, 90 ], [ "saga-debit", -30, 70 ] ], "balance": [ [ 1, 100 ] ], "inbox": [] }, "orders": { "orders": [], "outbox": [] } } } ] } }