Lune

EuroSys2025Top-tier venue

Multi-Grained Specifications for Distributed System Model Checking and Verification

Lingzhi Ouyang, Xudong Sun, Ruize Tang, Yu Huang, Madhav Jivrajani, Xiaoxing Ma, Tianyin Xu

Abstract

This paper presents our experience specifying and verifying the correctness of ZooKeeper, a complex and evolving distributed coordination system. We use TLA+ to model finegrained behaviors of ZooKeeper and use the TLC model checker to verify its correctness properties; we also check conformance between the model and code. The fundamental challenge is to balance the granularity of specifications and the scalability of model checking---fine-grained specifications lead to state-space explosion, while coarse-grained specifications introduce model-code gaps. To address this challenge, we write specifications with different granularities for composable modules, and compose them into mixed-grained specifications based on specific scenarios. For example, to verify code changes, we compose fine-grained specifications of changed modules and coarse-grained specifications that abstract away details of unchanged code with preserved interactions. We show that writing multi-grained specifications is a viable practice and can cope with model-code gaps without untenable state space, especially for evolving software where changes are typically local and incremental. We detected six severe bugs that violate five types of invariants and verified their code fixes; the fixes have been merged to ZooKeeper. We also improve the protocol design to make it easy to implement correctly.

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

3 top-tier papers have cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • Anvil: Verifying Liveness of Cluster Management Controllers cites Finding Invariants of Distributed Systems: It's a Small (Enough) World After All
  • Anvil: Verifying Liveness of Cluster Management Controllers cites Verus: Verifying Rust Programs using Linear Ghost Types
  • Anvil: Verifying Liveness of Cluster Management Controllers cites DistAI: Data-Driven Automated Invariant Learning for Distributed Protocols
  • SysMoBench: Evaluating AI on Formally Specifying Complex Real-World Systems cites Converos: Practical Model Checking for Verifying Rust OS Kernel Concurrency
  • SysMoBench: Evaluating AI on Formally Specifying Complex Real-World Systems cites Using Lightweight Formal Methods to Validate a Key-Value Storage Node in Amazon S3
  • DistAI: Data-Driven Automated Invariant Learning for Distributed Protocols cites Finding Invariants of Distributed Systems: It's a Small (Enough) World After All
  • Feedback-guided Adaptive Testing of Distributed Systems Designs cites Using Lightweight Formal Methods to Validate a Key-Value Storage Node in Amazon S3
  • Converos: Practical Model Checking for Verifying Rust OS Kernel Concurrency cites Using Lightweight Formal Methods to Validate a Key-Value Storage Node in Amazon S3
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers3

  1. Converos: Practical Model Checking for Verifying Rust OS Kernel ConcurrencyRuize Tang, Minghua Wang, Xudong Sun, Lin Huang et al.USENIX ATC 2025 · 4 citations
  2. Feedback-guided Adaptive Testing of Distributed Systems DesignsAo Li, Ankush Desai, Rohan PadhyeNSDI 2026 · 2 citations
  3. SysMoBench: Evaluating AI on Formally Specifying Complex Real-World SystemsQian Cheng, Ruize Tang, Emilie Ma, Finn Hackett et al.ICLR 2026 · 1 citation

Builds on20

  1. Verus: Verifying Rust Programs using Linear Ghost TypesAndrea Lattuada, Travis Hance, Chanhee Cho, Matthias Brun et al.OOPSLA 2023 · 86 citations
  2. DistAI: Data-Driven Automated Invariant Learning for Distributed ProtocolsJianan Yao, Runzhou Tao, Ronghui Gu, Jason Nieh et al.OSDI 2021 · 76 citations
  3. Finding Invariants of Distributed Systems: It's a Small (Enough) World After AllTravis Hance, Marijn Heule, Ruben Martins, Bryan ParnoNSDI 2021 · 69 citations
  4. Using Lightweight Formal Methods to Validate a Key-Value Storage Node in Amazon S3James Bornholt, Rajeev Joshi, Vytautas Astrauskas, Brendan Cully et al.SOSP 2021 · 63 citations
  5. Anvil: Verifying Liveness of Cluster Management ControllersXudong Sun, Wenjie Ma, Jiawei Tyler Gu, Zicheng Ma et al.OSDI 2024 · 50 citations

Related papers

  1. eXtreme Modelling in PracticeA. Jesse Jiryu Davis, Max Hirschhorn, Judah SchvimerVLDB 2020
  2. Modulo: Finding Convergence Failure Bugs in Distributed Systems with Divergence Resync ModelsBeom Heyn Kim, Taesoo Kim, David LieUSENIX ATC 2022 · 10 citations
  3. SandTable: Scalable Distributed System Model Checking with Specification-Level State ExplorationRuize Tang, Xudong Sun, Yu Huang, Yuyang Wei et al.EuroSys 2024 · 8 citations
  4. Model-Guided Fuzzing of Distributed SystemsEge Berkay Gulcan, Burcu Kulahcioglu Ozkan, Rupak Majumdar, Srinidhi NagendraOOPSLA 2025 · 3 citations
  5. Psym: Efficient Symbolic Exploration of Distributed SystemsLauren Pick, Ankush Desai, Aarti GuptaPLDI 2023 · 1 citation
Dusk over the sea between two cliffs drawn in fine vertical lines