You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@rocketmq.apache.org by GitBox <gi...@apache.org> on 2021/04/24 02:22:29 UTC

[GitHub] [rocketmq] panzhi33 commented on issue #2830: Message transfer to consumerQueue(Using reputService) should happen after the flush and slave replication operation in SYNC_MASTER and SYNC_FLUSH settings

panzhi33 commented on issue #2830:
URL: https://github.com/apache/rocketmq/issues/2830#issuecomment-826019739


   > Is there any code that indicates the SYNC_MASTER and SYNC_FLUSH mechanism? I rechecked that the reputMessageService(org.apache.rocketmq.store.DefaultMessageStore.ReputMessageService) relies on the commitedOffset to transfer commitlog to consumerQueue. It could be traced from ReputMessageService#doReput(). The SelectMappedBufferResult result = DefaultMessageStore.this.commitLog.getData(reputFromOffset); in doReput() finally use commitedOffset as the bound to do the reput. However, The commitedOffset is updated by the CommitRealTimeService (org.apache.rocketmq.store.CommitLog.CommitRealTimeService). This service will just update the commitedOffset periodly, which does not consider if the data is actually flushed to the disk. The flush operation is actually happened in another thread. There is no syncronization between them. So in this case, even in the SYNC_MASTER and SYNC_FLUSH settings, there is no gurantee to make the reputService waitfor the disk flush and slave replication.
   > I wonder if I miss something or this is what actually what rocketmq is designed.
   
   update broker config。you can see the configuration of the broker。
   they don`t wait,because only these two places are ok, the message is send successfully。You should look at the entire process of sending messages, not just this place
   


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org