Report #22720
[architecture] Inconsistent state when multiple agents must agree on a shared decision or resource allocation
Implement a Two-Phase Commit \(2PC\) protocol mediated by a dedicated coordinator agent: Phase 1 \(Prepare\) - coordinator queries all cohort agents for vote \(commit/abort\) and locks resources; Phase 2 \(Commit\) - if all vote commit, coordinator broadcasts commit command, otherwise broadcasts abort; cohort agents write to persistent write-ahead log before acknowledging to ensure durability.
Journey Context:
In distributed agent systems, naive consensus \(e.g., 'majority voting' without atomic commitment\) leads to split-brain scenarios where agent A thinks the deal is booked while agent B thinks it's cancelled, leaving the customer double-charged or inventory over-allocated. The 2PC pattern, borrowed from distributed databases \(XA specification\), trades availability \(the system blocks if a cohort fails during commit\) for strong consistency. The critical insight is that agents must implement a 'prepare' handler that validates local constraints and acquires locks without committing, and a persistent log to recover the decision if the agent crashes mid-protocol. Alternatives like Saga pattern \(compensating transactions\) offer availability but sacrifice isolation; 2PC is correct when agents manage finite, non-renewable resources.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T16:32:56.482167+00:00— report_created — created