Skip to content

[5.1.0]关于Dledger和controller疑问 #6172

Pinned Answered by RongtongJin
Hoxxx asked this question in Q&A
Discussion options

You must be logged in to vote

DLedger相关的高可用有两种模式

  1. RocketMQ 4.5 之后 DLedger模式被引入 RocketMQ

该架构主要是利用OpenMessaging中名为DLedger的Raft存储库来实现,DLedger存储层是仿照RocketMQ写的简化版本,传输层也用的RocketMQ Remoting,这样的切换架构依靠Raft自选举能力,仍然没有任何外部组件依赖。如图所示,最主要的区别是利用Raft CommitLog代替了原来CommitLog,使CommitLog拥有了选举复制的能力,然后通过角色透传的方式,把Raft的角色透传给外部Broker的角色,Leader对应原来Master的角色,Follower和Candidate对应原来的Slave角色,而Broker与其他外部组件如NameServer,客户端的交互仍然以Master/Slave的形式进行。现在,如果一个Master挂了,依靠Raft自动选主的能力,会重新选出一个Leader,然后通过角色透传变成新的Master对外服务。此外,Raft的算法也保证了数据的一致性,不会出现消息的丢失。

2.RocketMQ 5.0 后的Controller模式

1 中 DLedger 存在以下问题

  • Broker组内的副本数必须是3副本及以上才有切换能力,因此成本是有上升的。
  • Raft多数派限制导致三副本副本必须两副本响应才能返回,五副本需要三副本才能返回,因此ACK是不够灵活的,这也导致发送延迟和副本冗余间没有一个很好的可协商的方案。
  • 由于存储复制链路用的是OpenMessaging DLedger库,导致R…

Replies: 4 comments 15 replies

Comment options

You must be logged in to vote
7 replies
@mxsm
Comment options

@drivebyer
Comment options

@CatofWei
Comment options

@francisoliverlee
Comment options

@onejimmyboy
Comment options

Answer selected by Hoxxx
Comment options

You must be logged in to vote
6 replies
@SchopenhauerZhang
Comment options

@mxsm
Comment options

@RongtongJin
Comment options

@onejimmyboy
Comment options

@francisoliverlee
Comment options

Comment options

You must be logged in to vote
2 replies
@lizhimins
Comment options

@liangliplus
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet