Table of Contents
Fetching ...

Boosting End-to-End Database Isolation Checking via Mini-Transactions (Extended Version)

Hengfeng Wei, Jiang Xiao, Na Yang, Si Liu, Zijing Yin, Yuxing Chen, Anqun Pan

TL;DR

This work tackles the inefficiencies of black-box isolation checking in databases by introducing Mini-Transactions (MTs), compact read/write patterns that enable faster history generation and verification for strong isolation levels such as SSER, SER, and SI. By leveraging the read-modify-write structure and unique write values, MT histories admit highly efficient, linear- or quadratic-time verification algorithms, and MTs capture the 14 well-known isolation anomalies with at most four operations per transaction. The authors implement these algorithms and a MT workload generator in MTC, achieving substantial performance gains over state-of-the-art checkers in end-to-end testing and in detecting real-world bugs across production DBMSs. The approach reduces overhead, preserves bug-detection effectiveness, and offers a cost-efficient path for black-box isolation checking, with practical implications for deploying robust database systems. Overall, MTC demonstrates that MT-based testing can maintain strong coverage while dramatically improving efficiency in both history generation and verification.

Abstract

Transactional isolation guarantees are crucial for database correctness. However, recent studies have uncovered numerous isolation bugs in production databases. The common black-box approach to isolation checking stresses databases with large, concurrent, randomized transaction workloads and verifies whether the resulting execution histories satisfy specified isolation levels. For strong isolation levels such as strict serializability, serializability, and snapshot isolation, this approach often incurs significant end-to-end checking overhead during both history generation and verification. We address these inefficiencies through the novel design of Mini-Transactions (MTs). MTs are compact, short transactions that execute much faster than general workloads, reducing overhead during history generation by minimizing database blocking and transaction retries. By leveraging MTs' read-modify-write pattern, we develop highly efficient algorithms to verify strong isolation levels in linear or quadratic time. Despite their simplicity, MTs are semantically rich and effectively capture common isolation anomalies described in the literature. We implement our verification algorithms and an MT workload generator in a tool called MTC. Experimental results show that MTC outperforms state-of-the-art tools in both history generation and verification. Moreover, MTC can detect bugs across various isolation levels in production databases while maintaining the effectiveness of randomized testing with general workloads, making it a cost-effective solution for black-box isolation checking.

Boosting End-to-End Database Isolation Checking via Mini-Transactions (Extended Version)

TL;DR

This work tackles the inefficiencies of black-box isolation checking in databases by introducing Mini-Transactions (MTs), compact read/write patterns that enable faster history generation and verification for strong isolation levels such as SSER, SER, and SI. By leveraging the read-modify-write structure and unique write values, MT histories admit highly efficient, linear- or quadratic-time verification algorithms, and MTs capture the 14 well-known isolation anomalies with at most four operations per transaction. The authors implement these algorithms and a MT workload generator in MTC, achieving substantial performance gains over state-of-the-art checkers in end-to-end testing and in detecting real-world bugs across production DBMSs. The approach reduces overhead, preserves bug-detection effectiveness, and offers a cost-efficient path for black-box isolation checking, with practical implications for deploying robust database systems. Overall, MTC demonstrates that MT-based testing can maintain strong coverage while dramatically improving efficiency in both history generation and verification.

Abstract

Transactional isolation guarantees are crucial for database correctness. However, recent studies have uncovered numerous isolation bugs in production databases. The common black-box approach to isolation checking stresses databases with large, concurrent, randomized transaction workloads and verifies whether the resulting execution histories satisfy specified isolation levels. For strong isolation levels such as strict serializability, serializability, and snapshot isolation, this approach often incurs significant end-to-end checking overhead during both history generation and verification. We address these inefficiencies through the novel design of Mini-Transactions (MTs). MTs are compact, short transactions that execute much faster than general workloads, reducing overhead during history generation by minimizing database blocking and transaction retries. By leveraging MTs' read-modify-write pattern, we develop highly efficient algorithms to verify strong isolation levels in linear or quadratic time. Despite their simplicity, MTs are semantically rich and effectively capture common isolation anomalies described in the literature. We implement our verification algorithms and an MT workload generator in a tool called MTC. Experimental results show that MTC outperforms state-of-the-art tools in both history generation and verification. Moreover, MTC can detect bugs across various isolation levels in production databases while maintaining the effectiveness of randomized testing with general workloads, making it a cost-effective solution for black-box isolation checking.

Paper Structure

This paper contains 40 sections, 13 theorems, 6 equations, 18 figures, 2 tables, 2 algorithms.

Key Result

Lemma 1

If a history contains an instance of the Divergence pattern, then it does not satisfy SI.

Figures (18)

  • Figure 1: An SI violation (LostUpdate) detected in MariaDB Galera (v10.7.3). The core operations involved are underlined. This core comprises only three transactions with two operations each, which can be represented by our MTs.
  • Figure 2: Workflow of black-box isolation checking.
  • Figure 3: The Divergence pattern: $T_{2}$ and $T_{3}$ read the same value of $x$ from $T_{1}$ and write different values.
  • Figure 4: Illustration of linearizability on histories of R&W operations. The initial value of the object $x$ is $0$.
  • Figure 5: Capturing 14 isolation anomalies in contemporary specification frameworks Adya:PhDThesis1999Framework:CONCUR2015AnalysingSI:JACM2018Complexity:OOPSLA2019plume by MTs.
  • ...and 13 more figures

Theorems & Definitions (39)

  • Definition 1: Transaction
  • Definition 2: History
  • Definition 3: Dependency Graphs
  • Definition 4: Strict Serializability Adya:PhDThesis1999NCC:OSDI2023
  • Definition 5: Serializability AlgebraicLaw:CONCUR2017
  • Definition 6: Snapshot Isolation AnalysingSI:JACM2018
  • Example 1
  • Definition 7: Linearizability Lin:TOPLAS1990
  • Example 2
  • Definition 8: Mini-transaction; MT
  • ...and 29 more