Abstract
Large-scale replicated data type stores often resort to eventual consistency to guarantee low latency and high availability. It is widely accepted that programming over eventually consistent data stores is challenging, since arbitrary divergence among replicas is allowed. Moreover, pragmatic protocols actually achieve consistency guarantees stronger than eventual consistency, which can be and need to be utilized to facilitate the reasoning of and programming over replicated data types. Toward the challenges above, we propose the ViSearch framework for precise measurement of eventual consistency semantics. ViSearch employs the visibility-arbitration specification methodology in concurrent programming, which extends the linearizability-based specification methodology with a dynamic visibility relation among operations, in addition to the standard dynamic happen-before and linearization relations. The consistency measurement using ViSearch is NP-hard in general. To enable practical and efficient consistency measurement in replicated data type stores, the ViSearch framework refactors the existing brute-force checking algorithm to a generic algorithm skeleton, which further enables efficient pruning of the search space and effective parallelization. We employ the ViSearch framework for consistency measurement in two replicated data type stores Riak and CRDT-Redis. The experimental evaluation shows the usefulness and cost-effectiveness of consistency measurement based on the ViSearch framework in realistic scenarios.
Introduction
In large-scale distributed systems, developers frequently navigate the trade-offs between consistency, availability, and partition tolerance (the CAP theorem). Most modern systems opt for eventual consistency to ensure high availability and low latency. However, "eventual consistency" is often a vague umbrella term that masks the actual behavior of a system. In practice, a system might provide guarantees significantly stronger than "eventual," or it might exhibit divergence patterns that complicate application development.
Traditional consistency measurements are often "black-box," focusing on external metrics like staleness time. While useful, these metrics do not help developers understand the logical relationships—how updates are propagated or ordered—between operations. To address this, we present ViSearch, a "white-box" framework designed to precisely quantify consistency levels for replicated data types, such as Conflict-free Replicated Data Types (CRDTs).
The ViSearch Framework
ViSearch utilizes the Visibility-Arbitration (Vis-Ar) specification methodology. This model moves beyond simple linearizability by incorporating two key relations:
- Visibility: Determines which prior updates are visible to a given operation.
- Arbitration: Establishes a total order to resolve conflicts between concurrent updates.
Checking these relations is computationally intensive (NP-hard). ViSearch overcomes this through three primary innovations:
- Non-recursive Algorithm Skeleton: By refactoring recursive backtracking into a deque-based non-recursive structure, the framework manages intermediate states more effectively and facilitates search space pruning.
- Semantic Pruning: ViSearch leverages the specific logic of the data type under test (e.g., a Set or Priority Queue). If a candidate execution violates the fundamental rules of the data type—such as a query returning an element never added—the entire search branch is discarded.
- Parallelization: The independent nature of search subtrees allows for a coordinator-worker model, enabling efficient distribution across multiple CPU cores with dynamic load balancing.
The Consistency Spectrum
Consistency is not a binary state but a spectrum. ViSearch categorizes system behavior into a six-level hierarchy: Weak, Basic, Monotonic, Peer, Causal, and Complete.
By analyzing the internal visibility of operations, ViSearch provides diagnostic insights into why violations occur, rather than just reporting that they occurred. The framework focuses on "divergence intervals"—short periods where replicas have not yet synchronized—to find the weakest links in a system's consistency model.
Evaluation and Results
The authors evaluated ViSearch across ten replicated data types in two systems: Riak (a distributed NoSQL database) and CRDT-Redis (a multi-master Redis implementation).
Key findings include:
- Riak Configuration: While Riak with a read parameter of $r=1$ provides only "Weak" consistency, increasing this to a quorum ($r=2$) in low-latency environments effectively achieved "Complete" (strong) consistency.
- Conflict Resolution Impact: In CRDT-Redis, the "Remove-win" strategy for Priority Queues was significantly weaker ("Weak" consistency) than "Add-win" or "Observed-Remove" (Rwf) strategies, which reached "Peer" consistency.
- Efficiency: Semantic pruning reduced the explored state space by approximately 50%. The parallelized implementation demonstrated near-linear speedup, allowing the checking of 500,000 operation traces in minutes.
Conclusion
ViSearch provides a practical, scalable method for measuring the precise consistency guarantees of replicated data stores. By combining "white-box" visibility analysis with semantic-aware pruning, it enables developers to reason more effectively about distributed applications. Future work includes automating the generation of pruning templates and integrating ViSearch into the Jepsen testing framework to enhance industry-standard distributed systems testing.
Summary updated