Should truncate the commitLog base on confirmOffset?
See original GitHub issueHi Community, i have a silly question, when a slave broker will changing to master and the slave’s confirmOffset get from old master. It will recalculate the confirmOffset when AutoSwitchHAService#changeToMaster
, buf if the slave maxOffset > confirmOffset(this broker replicates relatively fast and the confirmOffset is the one that takes the smallest value of all syncStateSets ), In this case, will it cause the inconsistent messages? should we truncate the commitLog between confirmOffset to maxOffset?
Hope all your helps.
Issue Analytics
- State:
- Created a year ago
- Comments:10 (7 by maintainers)
Top Results From Across the Web
dev - The Mail Archive
GitBox; 2022/09/28 [GitHub] [rocketmq] lanlanbaby commented on issue #5209: Should truncate the commitLog base on confirmOffset? GitBox; 2022/09/28 [GitHub] ...
Read more >索引区分度 - Absurd博客
Get the raw commit log data starting from the given offset, which should used for ... Base counter value, used mainly when there...
Read more >didi/DDMQ:CommitLog$DefaultAppendMessageCallback ...
distributed under the License is distributed on an "AS IS" BASIS, ... this can not be included in truncate offset ... confirmOffset =...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
是的,这个和我的理解一致
Hi @lanlanbaby, it will not truncate the slave’s commitLog between confirmOffset to maxOffset before the slave changing to master. First, the transfer of confirmOffset is delayed, if the commitLog between confirmOffset to maxOffset is truncated, messages may be lost. In addition, we only guarantee that messages will not be lost. Messages between confirmOffset to maxOffset are uncertain (no ack to clients), so it doesn’t matter if these messages exist.