一起单独:弱隔离的组合推理和推理
Alone Together: Compositional Reasoning and Inference for Weak Isolation
摘要:
可串行性是一个很好理解的正确性标准,它通过确保并发事务在执行时相互隔离,简化了对并发事务行为的推理。然而,实施可串行化隔离会以性能为代价,因此数据库系统在实践中支持并经常鼓励开发人员使用较弱的替代方案来实现事务。不幸的是,弱隔离的语义并没有得到很好的理解,而且通常只在低级实现工件方面进行非正式的解释。因此,在这样的环境中验证高级别的正确性属性仍然是一个具有挑战性的问题。为了解决这个问题,我们提出了一种新的程序逻辑,使组合推理的行为并发执行弱隔离的事务。认识到使用这种逻辑所需的举证责任可能会劝阻应用程序开发人员,我们还描述了一个推理过程的基础上,保留最弱的隔离级别,仍然保证与此类事务相关联的高级别的一致性不变量的安全性。有效推理的关键是观察到弱隔离事务可以被视为抽象数据库状态上的函数(一元)计算,允许我们将其操作视为数据库上的状态Transformers。这种解释使得能够使用现成的SMT求解器进行自动验证。真实世界的应用程序(在OCaml的嵌入式DSL编写)的案例研究和实验证明了我们的方法的实用性。
英文摘要:
Serializability is a well-understood correctness criterion that simplifies reasoning about the behavior of concurrent transactions by ensuring they are isolated from each other while they execute. However, enforcing serializable isolation comes at a steep cost in performance and hence database systems in practice support, and often encourage, developers to implement transactions using weaker alternatives. Unfortunately, the semantics of weak isolation is poorly understood, and usually explained only informally in terms of low-level implementation artifacts. Consequently, verifying high-level correctness properties in such environments remains a challenging problem. To address this issue, we present a novel program logic that enables compositional reasoning about the behavior of concurrently executing weakly-isolated transactions. Recognizing that the proof burden necessary to use this logic may dissuade application developers, we also describe an inference procedure based on this foundation that ascertains the weakest isolation level that still guarantees the safety of high-level consistency invariants associated with such transactions. The key to effective inference is the observation that weakly-isolated transactions can be viewed as functional (monadic) computations over an abstract database state, allowing us to treat their operations as state transformers over the database. This interpretation enables automated verification using off-the-shelf SMT solvers. Case studies and experiments of real-world applications (written in an embedded DSL in OCaml) demonstrate the utility of our approach.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。