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 novel black-box checker that efficiently checks SI and provides understandable counterexamples upon detecting violations. PolySI builds on a novel 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 the compact constraint encoding of GPs and domain-specific optimizations for pruning constraints. As demonstrated by our extensive assessment, 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-sized workloads.
翻译:光速孤立(SI)是一个普遍的薄弱隔离水平,它避免了由序列性造成的性能处罚,同时防止了各种不理想的数据异常现象。然而,最近,在声称提供SI保证的生产云数据库中发现了SI异常现象。鉴于这类数据库内部的复杂和往往不存在,因此非常需要黑箱SI检查器。在本文中,我们介绍了PolySI,这是一个新的黑箱检查器,能有效地检查SI,并在发现违规情况时提供可以理解的反抽样。PolySI建立在使用通用测算仪(GPs)对SI的新定性的基础上,为此,我们建立了它的可靠性和完整性。多功能识别仪(SMT)使用SMT解答器,并且通过利用GP的紧凑约束编码和针对特定域的优化来加速SMT的解决。正如我们的广泛评估所证明的那样, MolySI成功地复制了所有已知的2477个SI异常现象,在三个生产云库中检测出新的SI违规现象,查明其原因,超越了工作量范围很广的常规黑箱检查器。