Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

TigerBeetle 4 min read Deep dive hardMaster

Simulation Testing For Liveness

TigerBeetle's VOPR simulator now has a "liveness" mode alongside its "safety" mode, because uniformly random, eventually-healing faults can never surface livelocks such as a permanently asymmetric partition that triggers endless view changes. After a period of random fault injection, the simulator picks a quorum as the core, restarts and heals everything inside it, makes all failures involving non-core replicas permanent, and then requires the core to process every transaction before a timeout. The new mode found a resonance bug in which parallel log repair combined with round-robin repair targets always sent each missing op to the one replica that also lacked it, a stall that previously cleared only when a restart reset the counter.

Related posts

  • Protocol-Aware Deterministic Simulation Testing

    TigerBeetle hardMaster

    TigerBeetle's deterministic simulator (the VOPR) has full visibility into each replica's consensus and storage state, so it can check invariants that black-box tools like Jepsen or Antithesis cannot see through user-facing APIs. For safety, it asserts that every committed WAL entry has matching checksums across replicas, that LSM manifest structure is consistent everywhere, and that replicas are byte-for-byte identical, which goes deeper than the cheaper production checks that crash a diverging backup. For liveness, it enforces per-replica invariants: a replica with an uncorrupted WAL must never need cluster coordination to recover, and missing blocks must be repaired from intact copies on other replicas whenever any copy still exists.

  • We Put a Distributed Database In the Browser – And Made a Game of It!

    TigerBeetle easyNovice

    TigerBeetle's deterministic simulator, the VOPR, is compiled to WebAssembly via Zig and wrapped in a playable browser game that runs real TigerBeetle replicas across three levels. The levels run under perfect conditions, then Jepsen-style network faults, crashes and latency, and finally up to 8% read and 9% write storage corruption per replica. The VOPR mocks all network and storage I/O in a single process, verifies linearizability and dilates time: 3.3 seconds of simulation covers 39 minutes of real-world testing, and a day covers two years. Getting the whole cluster under WebAssembly's 2 GiB memory limit was the main porting challenge, and the post contrasts VSR's round-robin view changes with Raft's randomized elections.

  • A Descent Into the Vörtex

    TigerBeetle mediumAdept

    TigerBeetle has added Vortex, a non-deterministic, generative full-system test harness that complements its Deterministic Simulation Testing by exercising real production binaries and client libraries from the outside in. A supervisor coordinates a cluster of stock replicas, a workload that checks safety properties, and language-specific client drivers (Zig and Java so far). It injects network faults through a TCP proxy, kills or pauses processes, and runs liveness checks. In four months it found two bugs: incorrect request batching in tb_client and double connection termination. Planned work includes continuous runs, upgrade testing, network partitions and storage faults.

  • A Tale Of Four Fuzzers

    TigerBeetle hardMaster

    TigerBeetle's Adaptive Replication Routing (ARR) puts the primary in the middle of a replication ring so no single dropped message is critical. It also reorders replicas dynamically by running routing experiments and measuring end-to-end prepare_ok latency rather than modeling the network. Testing it took four different fuzzers rather than relying only on the VOPR whole-system simulator. The key lesson is to design subsystems around minimal, data-oriented interfaces (integers for op, time and view instead of injected clocks or replicas) so they can be fuzzed in isolation. Small state spaces such as route encoding can be exhaustively enumerated instead of randomly sampled.

  • How we use formal modeling, lightweight simulations, and chaos testing to design reliable distributed systems

    Datadog Engineering hardMaster

    Datadog validated the design of Courier, a multi-tenant message queue built on multiple FoundationDB clusters after its March 2023 outage, by combining TLA+ formal modeling, lightweight simulations and chaos testing. Each tenant is sharded across 4 of 8 FoundationDB clusters so that no two tenants share the same set, and brokers health-check clusters and route around failures. The TLA+ spec models brokers, senders and receivers with weak fairness, and TLC checks properties such as at-least-once delivery across every reachable state. Simulations then cover what model checking cannot, such as latency, cost and scalability. Together these give design-level confidence that unit tests miss, at the cost of keeping models and simulations in sync with the design.

The quest for software engineering knowledge.

Look:
Layout: