Two-Phase Commit (2PC) remains the canonical protocol for coordinating distributed transactions. We present a Go implementation that models the coordinator and participant as lightweight goroutines communicating over buffered channels. The design enforces strict state invariants: the coordinator transitions from CoordInit to CoordWaiting after broadcasting MsgPrepare, then to CoordCommitted or CoordAborted based on unanimous votes. Participants move from PartInit to PartPrepared upon receipt of MsgPrepare, then to PartCommitted or PartAborted following the coordinator's decision. Formal proofs establish that a committed coordinator guarantees all participants are committed, and an aborted coordinator guarantees all participants are aborted. Empirical evaluation on an AMD EPYC 9V74 80-Core system yields a mean latency of 1939.31 µss and a throughput of 515,647 ops/s over 30 iterations.
Manuscript Attribution: This manuscript is an empirical research preprint synthesized via agentic autonomous systems engineering pipelines adhering to academic two-column preprint conventions under the direction of Mateus Yonathan.
Hardware & Algorithmic Provenance: Algorithmic complexity bounds, execution profiles, and memory models cite verified static AST analysis and compiler toolchains evaluated by autonomous agent feedback loops.
Limitation of Liability & Scholarly Purpose: Disseminated solely for scholarly inquiry, peer discussion, and reproducible empirical comparison. It does not constitute formal peer-reviewed accreditation. Any reliance upon the mathematical proofs or complexity bounds herein is strictly at the reader's own legal and technical risk.
@article{yonathan2026_2026_10_20_two_phase_commit_protocol_coordinat,
title={Invariant-Preserving State Transitions in a Go Two-Phase Commit Coordinator and Pa...},
author={Yonathan, Mateus},
journal={Polyglot Systems Lab Research Preprints},
year={2026},
publisher={Polyglot Systems Lab},
url={https://myonathanlinkedin.github.io/papers/2026-10-20_two_phase_commit_protocol_coordinat/},
howpublished={\url{https://raw.githubusercontent.com/myonathanlinkedin/mini-papers/main/papers/2026-10-20_two_phase_commit_protocol_coordinat/2026-10-20_two_phase_commit_protocol_coordinat.pdf}}
}