arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2111.14946cs.DC
收藏

MongoDB的XML事务一致性

Verifying Transactional Consistency of MongoDB

Hongrong Ouyang, Hengfeng Wei, Yu Huang, Haixiang Li, Anqun Pan

摘要:

MongoDB是一个流行的通用、面向文档的分布式NoSQL数据库。它支持三种不同部署中的事务:在独立节点中使用WiredTiger存储引擎的单文档事务,由主节点和多个辅助节点组成的副本集中的多文档事务,以及分片集群中的分布式事务,该集群是一组多个副本集,其中数据被分片。关于MongoDB transactions的一个自然而基本的问题是:每个部署中的MongoDB Transactions提供了什么样的transactions一致性保证?然而,它缺乏每个部署中MongoDB事务的简洁伪代码和MongoDB声称提供的一致性保证的正式规范。在这项工作中,我们正式指定和验证MongoDB的事务一致性协议。具体来说,我们根据官方文档和源代码,为每个MongoDB部署中的事务一致性协议,即WIREDTIGER,REPLICASET和SHARDEDCLUSTER提供了一个简洁的伪代码。然后,我们证明了WIREDTIGER,REPLICASET和SHARDEDCLUSTER满足不同的变种快照隔离,即强SI,实时SI,会话SI,分别。我们还针对MongoDB事务协议的一致性保证,提出并评估了有效的白盒检查算法,有效地规避了理论上的NP难障碍。

英文摘要:

MongoDB is a popular general-purpose, document-oriented, distributed NoSQL database. It supports transactions in three different deployments: single-document transactions utilizing the WiredTiger storage engine in a standalone node, multi-document transactions in a replica set which consists of a primary node and several secondary nodes, and distributed transactions in a sharded cluster which is a group of multiple replica sets, among which data is sharded. A natural and fundamental question about MongoDB transactions is: What transactional consistency guarantee do MongoDB Transactions in each deployment provide? However, it lacks both concise pseudocode of MongoDB transactions in each deployment and formal specification of the consistency guarantees which MongoDB claimed to provide. In this work, we formally specify and verify the transactional consistency protocols of MongoDB. Specifically, we provide a concise pseudocode for the transactional consistency protocols in each MongoDB deployment, namely WIREDTIGER, REPLICASET, and SHARDEDCLUSTER, based on the official documents and source code. We then prove that WIREDTIGER, REPLICASET, and SHARDEDCLUSTER satisfy different variants of snapshot isolation, namely Strong-SI, Realtime-SI, and Session-SI, respectively. We also propose and evaluate efficient white-box checking algorithms for MongoDB transaction protocols against their consistency guarantees, effectively circumventing the NP-hard obstacle in theory.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑