arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2603.00866cs.DB
收藏

面向OceanBase的树状两阶段提交框架:优化可扩展性与一致性

A Tree-Structured Two-Phase Commit Framework for OceanBase: Optimizing Scalability and Consistency

OceanBase, Ant Group(蚂蚁集团)

Quanqing Xu, Chen Qian, Chuanhui Yang, Fanyu Kong, Guixiang Liu, Fusheng Han, Zixiang Zhai

AI总结:

本文提出面向OceanBase的树状两阶段提交框架,通过日志流作为原子参与者、动态拓扑结构和状态机制,优化分布式数据库的可扩展性与一致性。

摘要:

现代分布式数据库在实现跨分布式分区的事务一致性方面面临挑战。传统两阶段提交(2PC)协议存在协调开销高和延迟大等问题,且对动态分区转移需要复杂的恢复机制。本文介绍了一种针对OceanBase的新型树状2PC框架,通过三个创新点利用单机日志流来解决这些问题。首先,我们提出日志流作为原子参与者,取代分区级协调。通过将每个日志流视为提交单元,跨越N个本地分区的事务仅与一个参与者交互,将协调开销减少数个数量级(例如,N=100时减少99%)。其次,我们设计了具有协调器根的DAG拓扑结构的树状2PC协议,通过递归构建提交树动态处理分区转移。当分区在事务期间迁移时,协议将迁移上下文作为叶节点嵌入,消除显式参与者列表更新,解决循环依赖问题,并在拓扑变化下确保线性可提交。第三,我们引入了prepare-unknown和trans-unknown状态,以防止参与者失去上下文时出现一致性问题。这些状态在重试期间信号不确定性,避免因所谓的“欺骗参与者”导致的错误中止,同时隔离用户免受模糊性影响。实验评估显示性能接近单机事务性能,具有更低的延迟和带宽消耗,验证了该框架对现代分布式数据库的有效性。

英文摘要:

Modern distributed databases face challenges in achieving transactional consistency across distributed partitions. Traditional two-phase commit (2PC) protocols incur high coordination overhead and latency, and require complex recovery for dynamic partition transfers. This paper introduces a novel tree-shaped 2PC framework for OceanBase that leverages single-machine log streams to address these challenges through three innovations. First, we propose log streams as atomic participants, replacing partition-level coordination. By treating each log stream as the commit unit, a transaction spanning $N$ co-located partitions interacts with one participant, reducing coordination overhead by orders of magnitude (e.g., 99 percent reduction for $N=100$). Second, we design a tree-shaped 2PC protocol with coordinator-rooted DAG topology that dynamically handles partition transfers by recursively constructing commit trees. When a partition migrates during a transaction, the protocol embeds migration contexts as leaf nodes, eliminating explicit participant list updates, resolving circular dependencies, and ensuring linearizable commits under topology changes. Third, we introduce prepare-unknown and trans-unknown states to prevent consistency violations when participants lose context. These states signal uncertainty during retries, avoiding erroneous aborts from so-called lying participants while isolating users from ambiguity. Experimental evaluation demonstrates performance approaching that of single-machine transactions, with reduced latency and bandwidth consumption, validating the framework's effectiveness for modern distributed databases.

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

↑