Replication Before Raft: 15 Years of Correctness at MongoDB
Categories: Podcasts , The BugBash Podcast
AI is accelerating software development by reducing coding time, shifting focus to correctness and reliability, especially in complex systems, with formal methods like TLA+ becoming crucial for verification. While AI aids in generating code and specifications, human expertise remains essential for defining high-level correctness properties, with future development likely involving higher abstraction and constrained AI guidance.
The BugBash Podcast
Tool vendor Antithesis podcast. Also the Bug Bash conference with videos on YouTube
Episode Details
- Show Notes: https://podcasters.spotify.com/pod/show/antithesis1/episodes/Replication-Before-Raft-15-Years-of-Correctness-at-MongoDB-e3o7sru
- Published: 2026-09-02T13:06:29Z
- Duration: 00:39:13
- Author: Antithesis
Overview
The podcast discusses how advancements in AI are transforming software development by significantly reducing the time needed to write code, creating an economic surplus that can be redirected toward improving software correctness and reliability. As AI-generated code becomes more prevalent, the focus is shifting from coding speed to ensuring systems behave as intended, especially in complex, concurrent, and mission-critical environments. This shift highlights the growing importance of formal methods, such as TLA+, for verifying distributed systems and ensuring correctness under all possible conditions.
A case study from MongoDB illustrates how a team of engineers without formal academic training used TLA+ to design and verify a custom replication protocol during their transition to Raft, demonstrating that formal verification is accessible and practical in industry settings. Despite progress, challenges remain in ensuring that implemented code conforms to its formal specification, particularly in large, multi-threaded systems where state observation is difficult. Tools like Antithesis are emerging to address these issues by enabling systematic exploration of system states and reliably reproducing rare, deep bugs that traditional testing methods often miss.
AI is also playing an increasing role in software development, particularly in generating algorithmic behavior and lowering the barrier to writing formal specifications. However, AI still struggles with defining high-level correctness properties such as safety and liveness, which require human expertise. While AI can assist in understanding system topology and generating test insights, it cannot replace the need for precise, mathematically grounded specifications. The discussion anticipates a future where human developers operate at higher levels of abstraction, focusing on defining correctness properties, designing system boundaries, and guiding AI within safe, constrained frameworks - mirroring historical shifts in engineering trust, such as the move from reviewing assembly to trusting compilers.
What If
-
What if you leveraged AI to draft TLA+ specifications for your core system logic, then validated them manually?
- Move: Use an LLM like Claude to generate initial TLA+ models of your critical components (e.g., state machines, concurrency logic), then refine and model-check them using TLC.
- Why Now?: AI has drastically lowered the entry barrier to formal specification - what once required deep expertise can now be bootstrapped quickly, especially for well-documented patterns like consensus or replication.
- Expected Upside: You gain a rigorously analyzable model of your system in days instead of months, reducing the risk of deep concurrency bugs and accelerating design validation.
-
What if you replaced random stress testing with Antithesis-style systematic testing in your CI pipeline?
- Move: Integrate a tool like Antithesis (or emulate its principles with stateful fuzzing and execution replay) to target rare interleavings in your concurrent modules, starting with your most failure-prone service.
- Why Now?: Traditional testing misses deep bugs that only emerge after thousands of hours; Antithesis has proven it can reproduce elusive bugs in under 24 hours, making previously “unfixable” issues tractable.
- Expected Upside: You shift from reactive debugging to proactive bug discovery, increasing system reliability and reducing production outages caused by race conditions.
-
What if you shifted your code review focus from implementation to correctness properties and test specifications?
- Move: Stop reviewing every line of AI-generated code; instead, require contributors to submit formal properties (e.g., invariants, safety/liveness conditions) and property-based tests, which you then review and verify.
- Why Now?: AI is generating code faster than humans can review it - just as we stopped reviewing assembly after trusting compilers, we must now move up the stack to reviewing intent and correctness.
- Expected Upside: You free up 70%+ of review time while improving software quality by focusing on what truly matters: whether the system behaves as intended under all conditions.
Takeaway
- Use AI tools like LLMs to draft initial TLA+ specifications for system behavior, but manually define and validate safety and liveness properties to ensure correctness.
- Adopt advanced testing tools such as Antithesis to systematically uncover and reproduce deep concurrency bugs in distributed systems, especially those resistant to traditional testing.
- Focus code review efforts on correctness properties, tests, and formal specifications rather than line-by-line implementation, aligning with the shift toward higher-level verification in AI-generated code environments.
- Invest time in writing precise, math-like specifications (e.g., using TLA+) even without full formal verification, as the process improves clarity and reduces critical design flaws.
- Apply formal methods like TLA+ incrementally on critical subsystems (e.g., replication, reconfiguration) using collaborative modeling sessions, even without academic training, to achieve robust and verifiably correct protocols.
For a PDF of longer Software Testing Podcast Episode Summaries with Briefing Notes and more detailed summary notes, visit EvilTester Patreon Podcast Summaries.