分布式系统模型检测与验证的多粒度规约
Multi-Grained Specifications for Distributed System Model Checking and Verification
AI总结:
本文针对复杂分布式系统ZooKeeper的模型检测与验证,提出多粒度规约方法以平衡细粒度规约的状态空间爆炸与粗粒度规约的模型代码差距,成功检测并修复六个严重错误。
摘要:
本文介绍了我们在规约和验证ZooKeeper(一个复杂且不断演进的分布式协调系统)正确性方面的经验。我们使用TLA+对ZooKeeper的细粒度行为进行建模,并使用TLC模型检测器验证其正确性属性;我们还检查了模型与代码之间的一致性。根本挑战在于平衡规约的粒度与模型检测的可扩展性——细粒度规约会导致状态空间爆炸,而粗粒度规约会引入模型与代码之间的差距。为了应对这一挑战,我们为可组合模块编写不同粒度的规约,并根据特定场景将它们组合成混合粒度规约。例如,为了验证代码变更,我们将已变更模块的细粒度规约与抽象掉未变更代码细节但保留交互的粗粒度规约组合起来。我们展示了编写多粒度规约是一种可行的实践,能够应对模型与代码的差距且不会产生难以承受的状态空间,特别是对于变更通常是局部和增量的演进式软件。我们检测到六个违反五种类型不变量的严重错误,并验证了它们的代码修复;这些修复已合并到ZooKeeper中。我们还改进了协议设计,使其易于正确实现。
英文摘要:
This paper presents our experience specifying and verifying the correctness of ZooKeeper, a complex and evolving distributed coordination system. We use TLA+ to model fine-grained behaviors of ZooKeeper and use the TLC model checker to verify its correctness properties; we also check conformance between the model and code. The fundamental challenge is to balance the granularity of specifications and the scalability of model checking -- fine-grained specifications lead to state-space explosion, while coarse-grained specifications introduce model-code gaps. To address this challenge, we write specifications with different granularities for composable modules, and compose them into mixed-grained specifications based on specific scenarios. For example, to verify code changes, we compose fine-grained specifications of changed modules and coarse-grained specifications that abstract away details of unchanged code with preserved interactions. We show that writing multi-grained specifications is a viable practice and can cope with model-code gaps without untenable state space, especially for evolving software where changes are typically local and incremental. We detected six severe bugs that violate five types of invariants and verified their code fixes; the fixes have been merged to ZooKeeper. We also improve the protocol design to make it easy to implement correctly.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。