arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2504.06975cs.PLcs.DB
收藏

AWDIT:一种最优的弱数据库隔离性测试器

AWDIT: An Optimal Weak Database Isolation Tester

Lasse Møldrup, Andreas Pavlogiannis

AI总结:

本文提出AWDIT,一种可证明最优的弱数据库隔离测试器,以$O(n^{3/2})$或$O(n \cdot k)$时间测试RC、RA和CC,实验显示相比最佳基线最高加速245倍。

摘要:

为了实现低延迟、高吞吐量和分区容错,现代数据库放弃了强事务隔离,转而采用弱隔离保证。然而,已发现多个生产数据库存在隔离性缺陷,破坏了其数据一致性契约。黑盒测试是一种检测隔离性缺陷的重要技术,其通过检查数据库事务历史是否符合规定的隔离级别来进行。\n\n在现实的大规模工作负载上测试数据库,要求隔离测试器尽可能高效,这一需求引发了对隔离测试复杂性的研究。尽管测试强隔离已被证明是NP完全的,但弱隔离级别最近被证明可以在多项式时间内测试,这推动了测试工具可扩展性的提升。然而,现有测试器具有较高的多项式复杂度,将测试限制在中等规模的工作负载上,而这并非大规模数据库的典型情况。\n\n在这项工作中,我们开发了AWDIT,一种高效且可证明最优的弱数据库隔离测试器。给定一个大小为$n$、包含$k$个会话的历史$H$,AWDIT分别以$O(n^{3/2})$、$O(n^{3/2})$和$O(n \cdot k)$的时间测试$H$是否满足最常见的弱隔离级别——读已提交(RC)、读原子(RA)和因果一致性(CC),相比现有技术有显著改进。此外,我们证明了AWDIT在本质上是渐近最优的,即对于RC和CC之间的任何弱隔离级别,存在一个条件性下界$n^{3/2}$。我们的实验表明,AWDIT比现有的高度优化的测试器显著更快;例如,对于约20%的最大历史,AWDIT在RC、RA和CC上分别比最佳基线获得了平均245倍、193倍和62倍的加速。

英文摘要:

In order to achieve low latency, high throughput, and partition tolerance, modern databases forgo strong transaction isolation for weak isolation guarantees. However, several production databases have been found to suffer from isolation bugs, breaking their data-consistency contract. Black-box testing is a prominent technique for detecting isolation bugs, by checking whether histories of database transactions adhere to a prescribed isolation level. Testing databases on realistic workloads of large size requires isolation testers to be as efficient as possible, a requirement that has initiated a study of the complexity of isolation testing. Although testing strong isolation has been known to be NP-complete, weak isolation levels were recently shown to be testable in polynomial time, which has propelled the scalability of testing tools. However, existing testers have a large polynomial complexity, restricting testing to workloads of only moderate size, which is not typical of large-scale databases. In this work, we develop AWDIT, a highly-efficient and provably optimal tester for weak database isolation. Given a history $H$ of size $n$ and $k$ sessions, AWDIT tests whether H satisfies the most common weak isolation levels of Read Committed (RC), Read Atomic (RA), and Causal Consistency (CC) in time $O(n^{3/2})$, $O(n^{3/2})$, and $O(n \cdot k)$, respectively, improving significantly over the state of the art. Moreover, we prove that AWDIT is essentially optimal, in the sense that there is a conditional lower bound of $n^{3/2}$ for any weak isolation level between RC and CC. Our experiments show that AWDIT is significantly faster than existing, highly optimized testers; e.g., for the $\sim$20% largest histories, AWDIT obtains an average speedup of $245\times$, $193\times$, and $62\times$ for RC, RA, and CC, respectively, over the best baseline.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑