RongtongJin commented on code in PR #4413:
URL: https://github.com/apache/rocketmq/pull/4413#discussion_r889780199
##########
docs/cn/controller/design.md:
##########
@@ -0,0 +1,206 @@
+# 背景
+
+当前 RocketMQ Raft 模式主要是利用 DLedger Commitlog 替换原来的 Commitlog,使 Commitlog
拥有选举复制能力,但这也造成了一些问题:
+
+- Raft 模式下,Broker组内副本数必须是三副本及以上。
+- RocketMQ 存在两套 HA 复制流程,且 Raft 模式下的复制无法利用 RocketMQ 原生的存储能力。
+- Raft 模式下, 日志复制性能并不高效。
+
+因此我们希望利用 DLedger 实现一个基于 Raft 的一致性模块(DLedger Controller),并当作一个可选的选主组件, 支持独立部署,
也可以嵌入在 Nameserver 中,Broker 通过与 Controller 的交互完成 Master 的选举, 从而解决上述问题, 我们奖该新模式称为
Controller 模式。
Review Comment:
我们将该新模式称为 Controller 模式
##########
broker/src/main/java/org/apache/rocketmq/broker/hacontroller/ReplicasManager.java:
##########
@@ -206,7 +206,10 @@ public void changeToSlave(final String newMasterAddress,
final int newMasterEpoc
handleSlaveSynchronize(BrokerRole.SLAVE);
// Notify ha service, change to slave
- this.haService.changeToSlave(newMasterAddress, newMasterEpoch,
this.brokerConfig.getBrokerId());
+ if (!this.haService.changeToSlave(newMasterAddress,
newMasterEpoch, this.brokerConfig.getBrokerId())) {
+ LOGGER.info("Failed to change ha role to slave");
+ return;
+ }
Review Comment:
如果失败了的话,上面的工作要不要回滚?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]