Skip to main content
QUICK REVIEW

[Paper Review] Automated Detection of Serializability Violations Under Weak Consistency

Kartik Nagar, Suresh Jagannathan|arXiv (Cornell University)|Jan 1, 2018
Distributed systems and fault toleranceComputer Science18 citations
TL;DR

This paper presents a fully automated, static analysis for detecting bounded serializability violations in SQL-based transactional applications under weak consistency models. By encoding program logic and consistency specifications in First-Order Logic (FOL), the approach uses SMT solvers to check for cycles in dependency graphs—indicating violations—while also providing two orthogonal schemes to verify serializability for unbounded executions. The method successfully detected anomalies in TPC-C and Courseware under Parallel Snapshot Isolation and verified serializability under Snapshot Isolation.

ABSTRACT

While a number of weak consistency mechanisms have been developed in recent years to improve performance and ensure availability in distributed, replicated systems, ensuring the correctness of transactional applications running on top of such systems remains a difficult and important problem. Serializability is a well-understood correctness criterion for transactional programs; understanding whether applications are serializable when executed in a weakly-consistent environment, however remains a challenging exercise. In this work, we combine a dependency graph-based characterization of serializability and leverage the framework of abstract executions to develop a fully-automated approach for statically finding bounded serializability violations under any weak consistency model. We reduce the problem of serializability to satisfiability of a formula in First-Order Logic (FOL), which allows us to harness the power of existing SMT solvers. We provide rules to automatically construct the FOL encoding from programs written in SQL (allowing loops and conditionals) and express consistency specifications as FOL formula. In addition to detecting bounded serializability violations, we also provide two orthogonal schemes to reason about unbounded executions by providing sufficient conditions (again, in the form of FOL formulae) whose satisfiability implies the absence of anomalies in any arbitrary execution. We have applied the proposed technique on TPC-C, a real-world database program with complex application logic, and were able to discover anomalies under Parallel Snapshot Isolation (PSI), and verify serializability for unbounded executions under Snapshot Isolation (SI), two consistency mechanisms substantially weaker than serializability.

Motivation & Objective

  • To address the challenge of ensuring correctness in transactional applications running on weakly consistent, geo-replicated databases.
  • To provide a precise, automated method for detecting bounded serializability violations without relying on imprecise static dependency graphs.
  • To verify the absence of serializability violations in unbounded executions using formal, FOL-based reasoning.
  • To enable the identification of minimal consistency upgrades that restore serializability in vulnerable applications.

Proposed method

  • The approach constructs dependency graphs from SQL programs and maps them to abstract executions using an event-based model with visibility and arbitration relations.
  • It encodes program dependencies and consistency model specifications as FOL formulas, reducing serializability checking to SMT satisfiability.
  • The method uses SMT solvers to determine whether any execution under the given consistency model can produce a cyclic dependency graph—indicating a serializability violation.
  • For unbounded executions, it applies two orthogonal schemes: one based on boundedness arguments and another using inductive reasoning via shortest path analysis.
  • The framework is parametric on consistency models, allowing it to identify the weakest consistency level that ensures serializability.
  • It supports complex SQL constructs including loops and conditionals, and generates concrete counterexamples when violations are found.

Experimental results

Research questions

  • RQ1Can we automatically detect bounded serializability violations in transactional SQL programs under any weak consistency model?
  • RQ2How can we formally verify the absence of serializability violations in unbounded executions without relying on runtime monitoring?
  • RQ3What is the minimal consistency upgrade required to eliminate detected violations while preserving performance?
  • RQ4Can we distinguish between harmful and harmless serializability violations using formal analysis?

Key findings

  • The approach successfully detected multiple serializability violations in TPC-C under Parallel Snapshot Isolation, including lost updates and over-enrollment anomalies.
  • In the Courseware application, violations were found under Eventual Consistency and Parallel Snapshot Isolation, including concurrent enrollment beyond capacity and inconsistent state reads.
  • After upgrading Enroll transactions to Snapshot Isolation, no further anomalies were found, and the analysis verified serializability for all unbounded executions.
  • The SMT solver produced results in under 10 seconds for all test cases, demonstrating practical efficiency.
  • The method identified a long fork anomaly under PSI that was harmless (both transactions failed), highlighting a limitation in distinguishing benign from harmful violations.
  • The shortest path analysis confirmed no dependency cycle of length ≥8 existed, which, combined with the absence of cycles ≤8, proved serializability for unbounded executions under SI.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.