Efficient Linearizability Checking for Actor-based Systems

Mohammed S. Al-Mahfoudh, Ryan Stutsman, Ganesh GopalakrishnanSoftw. Pract. Exp 2021

TL;DR

This paper introduces DS2, a framework for automatically checking the linearizability of actor-based systems. By combining advanced schedule exploration techniques with linearizability checking, DS2 helps developers find subtle bugs in concurrent systems without requiring complex manual specifications.

What Problem Does This Paper Address?

Developing correct distributed software, especially using actor-based frameworks, remains a significant challenge. While actor models simplify concurrency by using message passing, subtle bugs can still arise due to the complex interleaving of operations. Existing approaches to finding these bugs often involve either manual invariant specification, which is difficult and error-prone, or black-box testing against a sequential implementation, which might miss critical concurrent scenarios. This paper aims to bridge this gap by providing an automated approach that combines the strengths of schedule exploration and linearizability checking for actor systems.

Methods

The core of DS2 is its ability to automatically explore possible execution schedules of an actor system and then check if the observed behavior is equivalent to what a sequential implementation would produce. This involves:

  • DS2 Framework: An integrated system for specifying, synthesizing, and testing distributed actor systems.
  • Schedule Exploration: The paper evaluates seven different schedulers (Systematic Random, Exhaustive DFS, Delay-Bounded, DPOR, TransDPOR, IRed, and LiViola) to explore the state space of concurrent actor systems. These schedulers vary in their strategies for pruning the search space and prioritizing exploration.
  • Linearizability Checking: For each explored schedule, the system generates a history of operations. This history is then compared against a simple, sequential reference implementation of the system's abstract data type (ADT). If the concurrent execution's responses can be explained by some sequential ordering, it's considered linearizable.
  • New Schedulers (IRed and LiViola): The paper introduces IRed, which precisely tracks causal chains to improve schedule exploration, and LiViola, which specializes in linearizability violations by redefining dependence relations for key-value stores and allowing harness-level exclusions.

Datasets

The paper evaluates its approach on five different actor systems, including:

  • Correct Distributed Register (DR): A primary-backup replicated register.
  • Erroneous Distributed Register (EDR): A buggy version of the register with incorrect behaviors.
  • Another Distributed Register (ADR): A more complex register where all agents can act as leaders.
  • Open Chord (OC): A peer-to-peer distributed hash table.
  • Multi-Paxos (PX): A key-value map replicated using Paxos.

These systems are tested with different "harnesses" (sets of client invocations) that mix read and write operations to expose potential bugs.

Key Insights and Ideas

  • Schedule Pruning is Key: The paper strongly suggests that efficiently pruning the schedule exploration space is more critical for finding bugs than optimizing the history checking time itself.
  • Coverage Alone Isn't Enough: Approaches that solely aim to maximize "coverage" of schedules or histories are unlikely to find bugs unless they are extremely efficient, which is often infeasible due to the exponential nature of concurrency.
  • Chronological Uniqueness Can Be Misleading: Histories that are unique only chronologically (i.e., same events in a different order) can create an illusion of effectiveness for repetitive schedulers, masking their actual bug-finding capabilities.
  • Layering Complexity: Building complex schedulers by layering simpler, modular components (like IRed building on TransDPOR) is an effective strategy for managing complexity and achieving specialized functionalities.

Key Results

  • Effectiveness of IRed and LiViola: The new schedulers, IRed and LiViola, generally performed better in finding bugs and exploring schedules more efficiently compared to simpler schedulers, especially on more complex benchmarks.
  • LiViola's Specialization: LiViola showed significant improvements on benchmarks where its specialized harness exclusions could be applied, exploring far fewer schedules while still finding bugs.
  • Schedulers vs. History Checking: The study found that schedule exploration time was a much larger factor than history checking time, reinforcing the importance of efficient schedulers.
  • Bug Finding: The system successfully identified linearizability violations in various distributed systems, including a buggy distributed register and the Open Chord benchmark. For instance, in the Open Chord benchmark with a 4-invocation harness, LiViola found 49 unique histories, while Exhaustive DFS found only 325 unique histories with 15 bugs.

Limitations and Future Work

  • Conditionals: The current model has limitations in handling conditionals (if/while statements), which hinders more sophisticated static and dynamic analyses like symbolic execution.
  • Key Location Invisibility: For systems like Open Chord, LiViola faces challenges when the location of a key within a message payload is not known until runtime.
  • Future Work: The authors suggest extending the framework to handle conditionals, improve runtime key location determination for LiViola, and integrate more advanced analysis techniques like symbolic execution and concolic testing. They also plan to add more benchmarks and address more system faults.

Summary updated

BibTeX
@inproceedings{almahfoudh2021efficient,
  author = {Mohammed S. Al-Mahfoudh and Ryan Stutsman and Ganesh Gopalakrishnan},
  title = {{Efficient Linearizability Checking for Actor-based Systems}},
  booktitle = {Softw. Pract. Exp},
  year = {2021},
  url = {https://openreview.net/forum?id=dPJvxloNNF},
}
Figure