一句话:提出 Troc,将事务拆为独立语句并按声称隔离级别构造视图,通过执行分歧检测 DBMS 隔离性缺陷。
数据库管理系统(DBMS)依赖事务保证数据完整性,但广泛使用的 DBMS 仍会违反声称的事务隔离级别,产生隔离性缺陷,导致查询结果和数据库状态错误。本文提出事务测试方法 Troc:把事务解耦为独立语句,在声称隔离级别指导下为各语句构造数据库视图并独立执行;若实际事务执行与独立语句执行出现分歧,则判定存在隔离性缺陷。作者在 MySQL、MariaDB 和 TiDB 上实现并评估 Troc,在最新版本中检测到 5 个此前未知的隔离性缺陷。
Transactions are used to maintain the data integrity of databases, and have become an indispensable feature in modern Database Management Systems (DBMSs). Despite extensive efforts in testing DBMSs and verifying transaction processing mechanisms, isolation bugs still exist in widely-used DBMSs when these DBMSs violate their claimed transaction isolation levels. Isolation bugs can cause severe consequences, e.g., incorrect query results and database states. In this paper, we propose a novel transaction testing approach, Transaction oracle construction (Troc), to automatically detect isolation bugs in DBMSs. The core idea of Troc is to decouple a transaction into independent statements, and execute them on their own database views, which are constructed under the guidance of the claimed transaction isolation level. Any divergence between the actual transaction execution and the independent statement execution indicates an isolation bug. We implement and evaluate Troc on three widely-used DBMSs, i.e., MySQL, MariaDB, and TiDB. We have detected 5 previously-unknown isolation bugs in the latest versions of these DBMSs.
@inproceedings{DouCDSWGWWCWZH23,
title = {Detecting Isolation Bugs via Transaction Oracle Construction},
author = {Wensheng Dou and Ziyu Cui and Qianwang Dai and Jiansen Song and Dong Wang and Yu Gao and Wei Wang and Jun Wei and Lei Chen and Hanmo Wang and Hua Zhong and Tao Huang},
booktitle = {ICSE},
year = {2023},
doi = {10.1109/icse48619.2023.00101}
}