On the complexity of checking transactional consistency

Transactions simplify concurrent programming by enabling computations on shared data that are isolated from other concurrent computations and are resilient to failures. Modern databases provide different consistency models for transactions corresponding to different tradeoffs between consistency and availability. In this work, we investigate the problem of checking whether a given execution of a transactional database adheres to some consistency model. We show that consistency models like read committed, read atomic, and causal consistency are polynomial-time checkable while prefix consistency and snapshot isolation are NP-complete in general. These results complement a previous NP-completeness result concerning serializability. Moreover, in the context of NP-complete consistency models, we devise algorithms that are polynomial time assuming that certain parameters in the input executions, e.g., the number of sessions, are fixed. We evaluate the scalability of these algorithms in the context of several production databases.

[1]  Anca Muscholl,et al.  Trace Theory , 2011, Encyclopedia of Parallel Computing.

[2]  Patrice Godefroid,et al.  Dynamic partial-order reduction for model checking software , 2005, POPL '05.

[3]  Leslie Lamport,et al.  Time, clocks, and the ordering of events in a distributed system , 1978, CACM.

[4]  Jim Gray,et al.  A critique of ANSI SQL isolation levels , 1995, SIGMOD '95.

[5]  Rachid Guerraoui,et al.  On verifying causal consistency , 2016, POPL.

[6]  Pierre Wolper,et al.  Expressing interesting properties of programs in propositional temporal logic , 1986, POPL '86.

[7]  Marvin Theimer,et al.  Session guarantees for weakly consistent replicated data , 1994, Proceedings of 3rd International Conference on Parallel and Distributed Information Systems.

[8]  Krishnendu Chatterjee,et al.  Data-centric dynamic partial order reduction , 2016, Proc. ACM Program. Lang..

[9]  Alexey Gotsman,et al.  A Framework for Transactional Consistency Models with Atomic Visibility , 2015, CONCUR.

[10]  EneaConstantin,et al.  Sound, complete, and tractable linearizability monitoring for concurrent collections , 2017 .

[11]  Rupak Majumdar,et al.  Randomized testing of distributed systems with probabilistic guarantees , 2018, Proc. ACM Program. Lang..

[12]  Sebastian Burckhardt,et al.  Replicated data types: specification, verification, optimality , 2014, POPL.

[13]  Constantin Enea,et al.  Sound, complete, and tractable linearizability monitoring for concurrent collections , 2018, Proc. ACM Program. Lang..

[14]  Niklas Sörensson,et al.  An Extensible SAT-solver , 2003, SAT.

[15]  Sebastian Burckhardt,et al.  Global Sequence Protocol: A Robust Abstraction for Replicated Shared State , 2015, ECOOP.

[16]  Christos H. Papadimitriou,et al.  The serializability of concurrent database updates , 1979, JACM.

[17]  Parosh Aziz Abdulla,et al.  Optimal stateless model checking for reads-from equivalence under sequential consistency , 2019, Proc. ACM Program. Lang..

[18]  Phillip B. Gibbons,et al.  Testing Shared Memories , 1997, SIAM J. Comput..