An explanation of how sync and async replication work in eXtremeDB

本文详细解释了同步复制和异步复制的工作机制,包括数据传输过程、等待确认机制及异常处理策略。

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

Here is an explanation of howsync and async replication work:

 

Synchronous replication:

1.      Master sendstransaction data to replica using send() with commit_timeout.

2.      Then master waitsfor ACK from the replica during synch_timeout.

 

The first step is usuallysuccessful even if the replica has already died because the data for a singletransaction is relatively small and fits the OS's socket buffer. Thus, themaster detects the replica disconnection if it doesn't receive an ACK after synch_timeoutmsecs.

 

Asynchronous replication:

1.       mco_trans_commit() puts the transaction data to async.buffer is there is enough free space.

2.       Other thread running mco_HA_async_send_data_to_replicas()takes data from the buffer and sends it to the replica. (using commit_timeout)

Inthis case the replica doesn't send ACKs and if a replica dies; the transactionsdata fills a socket buffer, then the async. buffer, and the commit threadsticks on the semaphore as we see in the stack trace. After commit_timeout thesend() operation returns an error and master detects the replica disconnection.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值