rocketmq icon indicating copy to clipboard operation
rocketmq copied to clipboard

message may be lost because of slave can report greater than local commitLog offset in sync_mater mode

Open makabakaboom opened this issue 3 years ago • 2 comments

BUG REPORT

  1. Please describe the issue you observed:
  • What did you do (The steps to reproduce)?

1、创建一个SYNC_MASTER模式的集群 2、创建一个连接去连接同步端口,并往里面随机写一些数据 3、master节点会当做是slave上报的offset,并更新push2SlaveMaxOffset,导致后续写入消息可能未等到slave同步就已经返回producer 4、此时master宕机可能就会造成部分数据写master成功,但是还未由pageCache写入到磁盘,且未同步到slave而丢失

  • What did you expect to see?

1、判断为不合适的offset,并断掉连接

  • What did you see instead?

master节点会当做是slave上报的offset,并更新push2SlaveMaxOffset,导致后续写入消息可能未等到slave同步就已经返回producer

  1. Please tell us about your environment:

最新环境 3. Other information (e.g. detailed explanation, logs, related issues, suggestions how to fix, etc):

makabakaboom avatar Jun 20 '21 08:06 makabakaboom

这个问题我们也遇到,我们的解决办法是给主从同步的tcp连接增加一个握手,我认为这才是根本的解决办法。

不过这样一改就有点不兼容了,比如新旧版本的broker之间无法建立连接,所以这个修改我一直没提交。

areyouok avatar Sep 06 '21 13:09 areyouok

This issue is stale because it has been open for 365 days with no activity. It will be closed in 3 days if no further activity occurs.

github-actions[bot] avatar Sep 20 '22 00:09 github-actions[bot]

This issue was closed because it has been inactive for 3 days since being marked as stale.

github-actions[bot] avatar Sep 23 '22 04:09 github-actions[bot]