Abstract
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.
Supplemental Material
- Parosh Aziz Abdulla, Mohamed Faouzi Atig, Bengt Jonsson, Magnus Lång, Tuan Phong Ngo, and Konstantinos (Kostis) Sagonas. 2019. Optimal Stateless Model Checking for Read-from Equivalence under Sequential Consistency. PACMPL OOPSLA.Google Scholar
- Antidote. 2019a. https://www.antidotedb.eu Retrieved March 28th, 2019.Google Scholar
- Antidote. 2019b. https://antidotedb.gitbook.io/documentation/overview/configuration Retrieved March 28th, 2019.Google Scholar
- Hal Berenson, Philip A. Bernstein, Jim Gray, Jim Melton, Elizabeth J. O’Neil, and Patrick E. O’Neil. 1995. A Critique of ANSI SQL Isolation Levels. In Proceedings of the 1995 ACM SIGMOD International Conference on Management of Data, San Jose, California, USA, May 22-25, 1995., Michael J. Carey and Donovan A. Schneider (Eds.). ACM Press, 1–10. Google Scholar
Digital Library
- Ranadeep Biswas and Constantin Enea. 2019. On the Complexity of Checking Transactional Consistency. abs/1908.04509 (2019). arXiv: 1908.04509 https://arxiv.org/abs/1908.04509Google Scholar
- Ahmed Bouajjani, Constantin Enea, Rachid Guerraoui, and Jad Hamza. 2017. On verifying causal consistency. In Proceedings of the 44th ACM SIGPLAN Symposium on Principles of Programming Languages, POPL 2017, Paris, France, January 18-20, 2017, Giuseppe Castagna and Andrew D. Gordon (Eds.). ACM, 626–638. http://dl.acm.org/citation.cfm?id=3009888Google Scholar
Digital Library
- Sebastian Burckhardt, Alexey Gotsman, Hongseok Yang, and Marek Zawirski. 2014. Replicated data types: specification, verification, optimality. In The 41st Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, POPL ’14, San Diego, CA, USA, January 20-21, 2014, Suresh Jagannathan and Peter Sewell (Eds.). ACM, 271–284. Google Scholar
Digital Library
- Sebastian Burckhardt, Daan Leijen, Jonathan Protzenko, and Manuel Fähndrich. 2015. Global Sequence Protocol: A Robust Abstraction for Replicated Shared State. In 29th European Conference on Object-Oriented Programming, ECOOP 2015, July 5-10, 2015, Prague, Czech Republic (LIPIcs), John Tang Boyland (Ed.), Vol. 37. Schloss Dagstuhl - Leibniz-Zentrum fuer Informatik, 568–590. Google Scholar
Cross Ref
- Andrea Cerone, Giovanni Bernardi, and Alexey Gotsman. 2015. A Framework for Transactional Consistency Models with Atomic Visibility. In 26th International Conference on Concurrency Theory, CONCUR 2015, Madrid, Spain, September 1.4, 2015 (LIPIcs), Luca Aceto and David de Frutos-Escrig (Eds.), Vol. 42. Schloss Dagstuhl - Leibniz-Zentrum fuer Informatik, 58–71. Google Scholar
- Marek Chalupa, Krishnendu Chatterjee, Andreas Pavlogiannis, Nishant Sinha, and Kapil Vaidya. 2018. Data-centric dynamic partial order reduction. PACMPL 2, POPL (2018), 31:1–31:30. Google Scholar
Digital Library
- Cockroach. 2019a. https://github.com/cockroachdb/cockroach Retrieved March 28th, 2019.Google Scholar
- Cockroach. 2019b. https://www.cockroachlabs.com/docs/v2.1/transactions.html#isolation- levels Retrieved March 28th, 2019.Google Scholar
- Niklas Eén and Niklas Sörensson. 2003. An Extensible SAT-solver. In Theory and Applications of Satisfiability Testing, 6th International Conference, SAT 2003. Santa Margherita Ligure, Italy, May 5-8, 2003 Selected Revised Papers (Lecture Notes in Computer Science), Enrico Giunchiglia and Armando Tacchella (Eds.), Vol. 2919. Springer, 502–518. Google Scholar
Cross Ref
- Michael Emmi and Constantin Enea. 2018. Sound, complete, and tractable linearizability monitoring for concurrent collections. PACMPL 2, POPL (2018), 25:1–25:27. Google Scholar
Digital Library
- Cormac Flanagan and Patrice Godefroid. 2005. Dynamic partial-order reduction for model checking software. In Proceedings of the 32nd ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, POPL 2005, Long Beach, California, USA, January 12-14, 2005, Jens Palsberg and Martín Abadi (Eds.). ACM, 110–121. Google Scholar
Digital Library
- Galera. 2019a. http://galeracluster.com Retrieved March 28th, 2019.Google Scholar
- Galera. 2019b. http://galeracluster.com/documentation- webpages/faq.html Retrieved March 28th, 2019.Google Scholar
- Galera. 2019c. http://galeracluster.com/documentation- webpages/isolationlevels.html#intra- node- vs- inter- node- isolationin- galera- cluster Retrieved March 28th, 2019.Google Scholar
- Phillip B. Gibbons and Ephraim Korach. 1997. Testing Shared Memories. SIAM J. Comput. 26, 4 (1997), 1208–1244. Google Scholar
Digital Library
- Kyle Kingsbury. 2013-2019. http://jepsen.io Retrieved March 28th, 2019.Google Scholar
- Kyle Kingsbury. 2015. https://github.com/jepsen- io/jepsen/blob/master/galera/src/jepsen/galera/dirty_reads.clj Retrieved March 28th, 2019.Google Scholar
- Leslie Lamport. 1978. Time, Clocks, and the Ordering of Events in a Distributed System. Commun. ACM 21, 7 (1978), 558–565. Google Scholar
Digital Library
- Antoni W. Mazurkiewicz. 1986. Trace Theory. In Petri Nets: Central Models and Their Properties, Advances in Petri Nets 1986, Part II, Proceedings of an Advanced Course, Bad Honnef, Germany, 8-19 September 1986 (Lecture Notes in Computer Science), Wilfried Brauer, Wolfgang Reisig, and Grzegorz Rozenberg (Eds.), Vol. 255. Springer, 279–324. Google Scholar
Cross Ref
- Burcu Kulahcioglu Ozkan, Rupak Majumdar, Filip Niksic, Mitra Tabaei Befrouei, and Georg Weissenbacher. 2018. Randomized testing of distributed systems with probabilistic guarantees. PACMPL 2, OOPSLA (2018), 160:1–160:28. Google Scholar
Digital Library
- Christos H. Papadimitriou. 1979. The serializability of concurrent database updates. J. ACM 26, 4 (1979), 631–653. Google Scholar
Digital Library
- Douglas B. Terry, Alan J. Demers, Karin Petersen, Mike Spreitzer, Marvin Theimer, and Brent B. Welch. 1994. Session Guarantees for Weakly Consistent Replicated Data. In Proceedings of the Third International Conference on Parallel and Distributed Information Systems (PDIS 94), Austin, Texas, USA, September 28-30, 1994. IEEE Computer Society, 140–149. Google Scholar
Cross Ref
- Pierre Wolper. 1986. Expressing Interesting Properties of Programs in Propositional Temporal Logic. In Conference Record of the Thirteenth Annual ACM Symposium on Principles of Programming Languages, St. Petersburg Beach, Florida, USA, January 1986. ACM Press, 184–193. Google Scholar
Digital Library
Index Terms
On the complexity of checking transactional consistency
Recommendations
Consistency in Non-Transactional Distributed Storage Systems
Over the years, different meanings have been associated with the word consistency in the distributed systems community. While in the ’80s “consistency” typically meant strong consistency, later defined also as linearizability, in recent years, with the ...
Checking Robustness Between Weak Transactional Consistency Models
Programming Languages and SystemsAbstractConcurrent accesses to databases are typically encapsulated in transactions in order to enable isolation from other concurrent computations and resilience to failures. Modern databases provide transactions with various semantics corresponding to ...
Characterizing Transactional Memory Consistency Conditions Using Observational Refinement
Transactional memory (TM) facilitates the development of concurrent applications by letting a programmer designate certain code blocks as atomic. The common approach to stating TM correctness is through a consistency condition that restricts the ...






Comments