lizhimins commented on issue #5209:
URL: https://github.com/apache/rocketmq/issues/5209#issuecomment-1272273146

   > @lizhimins @RongtongJin 
Controller模式下应该不太涉及到日志状态机,我提出的疑问是:当前的代码实现,分发领先(dispatchBehind)是用confirmOffset减reputFromOffset,在切换时如果不先把confirmOffset重置到maxOffset,比如reputFromOffset=confirmOffset
 < 
maxOffset时,那truncateInvalidMsg可能就有问题了,我的理解是在truncateInvalidMsg前后都应该计算一下confirmOffset。
   
   是的,这个和我的理解一致
   - truncate 前 fix confirmOffset = maxOffset 是为了 apply unconfirmed 
log,这样才能不丢已提交的消息
   - truncate 后 fix confirmOffset 是为了让主备对齐


-- 
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]

Reply via email to