skip to main content
research-article
Artifacts Available / v1.1

Efficient Black-Box Checking of Snapshot Isolation in Databases

Published:01 February 2023Publication History
Skip Abstract Section

Abstract

Snapshot isolation (SI) is a prevalent weak isolation level that avoids the performance penalty imposed by serializability and simultaneously prevents various undesired data anomalies. Nevertheless, SI anomalies have recently been found in production cloud databases that claim to provide the SI guarantee. Given the complex and often unavailable internals of such databases, a black-box SI checker is highly desirable.

In this paper we present PolySI, a black-box checker that efficiently checks SI and provides understandable counterexamples upon detecting violations. PolySI builds on a characterization of SI using generalized polygraphs (GPs), for which we establish its soundness and completeness. PolySI employs an SMT solver and also accelerates SMT solving by utilizing a compact constraint encoding of GPs and domain-specific optimizations for pruning constraints. As our extensive assessment demonstrates, PolySI successfully reproduces all of 2477 known SI anomalies, detects novel SI violations in three production cloud databases, identifies their causes, outperforms the state-of-the-art black-box checkers under a wide range of workloads, and can scale up to large workloads.

References

  1. Atul Adya. 1999. Weak Consistency: A Generalized Theory and Optimistic Implementations for Distributed Transactions. Ph.D. Dissertation. USA.Google ScholarGoogle Scholar
  2. Peter Bailis, Aaron Davidson, Alan Fekete, Ali Ghodsi, Joseph M. Hellerstein, and Ion Stoica. 2013. Highly Available Transactions: Virtues and Limitations. Proc. VLDB Endow. 7, 3 (nov 2013), 181--192. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. Sam Bayless, Noah Bayless, Holger H. Hoos, and Alan J. Hu. 2015. SAT modulo Monotonic Theories. In Proceedings of the Twenty-Ninth AAAI Conference on Artificial Intelligence (AAAI'15). AAAI Press, 3702--3709.Google ScholarGoogle Scholar
  4. Hal Berenson, Phil Bernstein, Jim Gray, Jim Melton, Elizabeth O'Neil, and Patrick O'Neil. 1995. A Critique of ANSI SQL Isolation Levels. In SIGMOD '95. ACM, 1--10. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. Philip A Bernstein, Vassos Hadzilacos, and Nathan Goodman. 1986. Concurrency Control and Recovery in Database Systems. Addison-Wesley Longman Publishing Co., Inc., USA.Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. Ranadeep Biswas and Constantin Enea. 2019. On the Complexity of Checking Transactional Consistency. Proc. ACM Program. Lang. 3, OOPSLA, Article 165 (Oct. 2019), 28 pages. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. Ranadeep Biswas, Diptanshu Kakwani, Jyothi Vedurada, Constantin Enea, and Akash Lal. 2021. MonkeyDB: Effectively Testing Correctness under Weak Isolation Levels. Proc. ACM Program. Lang. 5, OOPSLA, Article 132 (oct 2021), 27 pages. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. Ahmed Bouajjani, Constantin Enea, Rachid Guerraoui, and Jad Hamza. 2017. On verifying causal consistency. In POPL'17. ACM, 626--638.Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. Andrea Cerone, Giovanni Bernardi, and Alexey Gotsman. 2015. A Framework for Transactional Consistency Models with Atomic Visibility. In CONCUR'15 (LIPIcs), Vol. 42. Schloss Dagstuhl-Leibniz-Zentrum fuer Informatik, 58--71.Google ScholarGoogle Scholar
  10. Andrea Cerone and Alexey Gotsman. 2018. Analysing Snapshot Isolation. J. ACM 65, 2, Article 11 (Jan. 2018), 41 pages. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. Manuel Clavel, Francisco Durán, Steven Eker, Patrick Lincoln, Narciso Martí-Oliet, José Meseguer, and Carolyn Talcott. 2007. All about Maude - a High-Performance Logical Framework: How to Specify, Program and Verify Systems in Rewriting Logic. Springer-Verlag, Berlin, Heidelberg.Google ScholarGoogle Scholar
  12. MariaDB Galera Cluster. Accessed February 14, 2023. https://mariadb.com/kb/en/what-is-mariadb-galera-cluster/.Google ScholarGoogle Scholar
  13. CockroachDB. Accessed February 14, 2023. https://www.cockroachlabs.com/.Google ScholarGoogle Scholar
  14. Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest, and Clifford Stein. 2009. Introduction to Algorithms, Third Edition (3rd ed.). The MIT Press.Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. Natacha Crooks, Youer Pu, Lorenzo Alvisi, and Allen Clement. 2017. Seeing is Believing: A Client-Centric Specification of Database Isolation. In PODC '17. ACM, 73--82. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. Ben Darnell. Accessed February 14, 2023. Lessons Learned from 2+ Years of Nightly Jepsen Tests. https://www.cockroachlabs.com/blog/jepsen-tests-lessons/.Google ScholarGoogle Scholar
  17. Oracle Database. Accessed February 14, 2023. https://www.oracle.com/database/.Google ScholarGoogle Scholar
  18. Khuzaima Daudjee and Kenneth Salem. 2006. Lazy Database Replication with Snapshot Isolation. In VLDB'06. VLDB Endowment, 715--726.Google ScholarGoogle Scholar
  19. Dgraph. Accessed February 14, 2023. https://dgraph.io/.Google ScholarGoogle Scholar
  20. Yifan Gan, Xueyuan Ren, Drew Ripberger, Spyros Blanas, and Yang Wang. 2020. IsoDiff: Debugging Anomalies Caused by Weak Isolation. Proc. VLDB Endow. 13, 12 (July 2020), 2773--2786. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. Graphviz. Accessed February 14, 2023. Open source graph visualization software. https://graphviz.org/.Google ScholarGoogle Scholar
  22. Kaile Huang, Si Liu, Zhenge Chen, Hengfeng Wei, David Basin, Haixiang Li, and Anqun Pan. 2022. Efficient Black-box Checking of Snapshot Isolation in Databases. Technical Report. https://arxiv.org/abs/2301.07313.Google ScholarGoogle Scholar
  23. Kaile Huang, Si Liu, Zhenge Chen, Hengfeng Wei, David Basin, Haixiang Li, and Anqun Pan. Accessed February 14, 2023. Issue #17. https://github.com/jepsen-io/elle/issues/17.Google ScholarGoogle Scholar
  24. Jepsen. Accessed February 14, 2023. https://jepsen.io.Google ScholarGoogle Scholar
  25. Jepsen. Accessed February 14, 2023. Issue #824. https://github.com/YugaByte/yugabyte-db/issues/824.Google ScholarGoogle Scholar
  26. Nick Kallen. Accessed February 14, 2023. Big Data in Real Time at Twitter. https://www.infoq.com/presentations/Big-Data-in-Real-Time-at-Twitter/.Google ScholarGoogle Scholar
  27. Kyle Kingsbury and Peter Alvaro. 2020. Elle: Inferring Isolation Anomalies from Experimental Observations. Proc. VLDB Endow. 14, 3 (Nov. 2020), 268--280.Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. Si Liu, Peter Csaba Ölveczky, Min Zhang, Qi Wang, and José Meseguer. 2019. Automatic Analysis of Consistency Properties of Distributed Transaction Systems in Maude. In TACAS 2019 (LNCS), Vol. 11428. Springer, 40--57.Google ScholarGoogle Scholar
  29. Wyatt Lloyd, Michael J. Freedman, Michael Kaminsky, and David G. Andersen. 2013. Stronger semantics for low-latency geo-replicated storage. In NSDI' 13. USENIX Association, 313--328.Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. Haonan Lu, Siddhartha Sen, and Wyatt Lloyd. 2020. Performance-Optimal Read-Only Transactions. In OSDI 2020. USENIX Association, 333--349.Google ScholarGoogle Scholar
  31. MongoDB. Accessed February 14, 2023. https://www.mongodb.com/.Google ScholarGoogle Scholar
  32. Christos H. Papadimitriou. 1979. The Serializability of Concurrent Database Updates. J. ACM 26, 4 (oct 1979), 631--653. Google ScholarGoogle ScholarDigital LibraryDigital Library
  33. Daniel Peng and Frank Dabek. 2010. Large-Scale Incremental Processing Using Distributed Transactions and Notifications. In OSDI'10. USENIX Association, USA, 251--264.Google ScholarGoogle ScholarDigital LibraryDigital Library
  34. PostgreSQL. Accessed February 14, 2023. Transaction Isolation. https://www.postgresql.org/docs/current/transaction-iso.html.Google ScholarGoogle Scholar
  35. RUBiS. Accessed February 14, 2023. Auction Site for e-Commerce Technologies Benchmarking. https://projects.ow2.org/view/rubis/.Google ScholarGoogle Scholar
  36. Microsoft SQL Server. Accessed February 14, 2023. https://www.microsoft.com/en-us/sql-server/.Google ScholarGoogle Scholar
  37. Yair Sovran, Russell Power, Marcos K. Aguilera, and Jinyang Li. 2011. Transactional Storage for Geo-Replicated Systems. In SOSP '11. ACM, 385--400. Google ScholarGoogle ScholarDigital LibraryDigital Library
  38. Cheng Tan, Changgeng Zhao, Shuai Mu, and Michael Walfish. 2020. COBRA: Making Transactional Key-Value Stores Verifiably Serializable. In OSDI'20. Article 4, 18 pages.Google ScholarGoogle Scholar
  39. 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 PDIS. IEEE Computer Society, 140--149.Google ScholarGoogle ScholarDigital LibraryDigital Library
  40. Jepsen testing of MongoDB 4.2.6. Accessed February 14, 2023. http://jepsen.io/analyses/mongodb-4.2.6.Google ScholarGoogle Scholar
  41. Jepsen testing of TiDB 2.1.7. Accessed February 14, 2023. https://jepsen.io/analyses/tidb-2.1.7.Google ScholarGoogle Scholar
  42. TiDB. Accessed February 14, 2023. https://en.pingcap.com/tidb/.Google ScholarGoogle Scholar
  43. TPC. Accessed February 14, 2023. TPC-C: On-Line Transaction Processing Benchmark. https://www.tpc.org/tpcc/.Google ScholarGoogle Scholar
  44. Todd Warszawski and Peter Bailis. 2017. ACIDRain: Concurrency-Related Attacks on Database-Backed Web Applications. In SIGMOD 2017. ACM, 5--20. Google ScholarGoogle ScholarDigital LibraryDigital Library
  45. Shale Xiong, Andrea Cerone, Azalea Raad, and Philippa Gardner. 2020. Data Consistency in Transactional Storage Systems: A Centralised Semantics. In ECOOP'20, Vol. 166. 21:1--21:31. Google ScholarGoogle ScholarCross RefCross Ref
  46. YugabyteDB. Accessed February 14, 2023. https://www.yugabyte.com/.Google ScholarGoogle Scholar
  47. Kamal Zellag and Bettina Kemme. 2014. Consistency anomalies in multi-tier architectures: automatic detection and prevention. VLDB J. 23, 1 (2014), 147--172. Google ScholarGoogle ScholarDigital LibraryDigital Library
  48. Rachid Zennou, Ranadeep Biswas, Ahmed Bouajjani, Constantin Enea, and Mohammed Erradi. 2019. Checking Causal Consistency of Distributed Databases. In NETYS 2019 (LNCS), Vol. 11704. Springer, 35--51. Google ScholarGoogle ScholarDigital LibraryDigital Library

Recommendations

Comments

Login options

Check if you have access through your login credentials or your institution to get full access on this article.

Sign in

Full Access

  • Article Metrics

    • Downloads (Last 12 months)39
    • Downloads (Last 6 weeks)2

    Other Metrics

PDF Format

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader