eXtremeDB HA synchronization procedure

本文详细阐述了数据库同步过程中的核心机制,包括主从数据库之间的序列号同步、交易提交后的序列号更新及发送、以及复制节点成功应用事务后的序列号设置。通过比较主节点和复制节点的序列号值,实现同步需求的判断。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Here is the description of synchronization procedure:

1.      Masterand replica databases have a ha_sequencer - 64bit integer which is initializedby zero at startup.

2.      Masterincrements the sequencer at each commit of a WRITE transaction and sends thesequencer value along with transaction data to the replica(s)

3.      Ifthe replica successfully applies the received transaction, it sets itssequencer to the received value. So after the transaction was committed, thevalues of the ha_sequencer are the same on the master and replica.

4.      Whenthe replica connects to the master, it sends the value of ha_sequencer. Mastercompare its own value with received one. If values are equal, this means thatthe master and replica have the same database version and no synchronization isrequired - replica reports MCO_REPL_NOTIFY_DB_EQUAL notification code.

5.      Otherwise(if master's and replica's sequencer values are different), the masterinitiates the synchronization procedure depending on the mode_flags - static,hot-sync or stateful initialization.

 

So, the DB_EQUAL code means that the values ofha_sequencers on the master and replica are equal. If the replica's database isin-memory and newly created, the replica's sequencer is 0. This means that themaster's sequencer is also 0. But this is possible only if the master didn'tperform write transactions since creation of the database.

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值