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 2018/12/05 03:50:50 UTC

[GitHub] hutu92 opened a new issue #577: fix lastFlushTimestamp usage

hutu92 opened a new issue #577: fix lastFlushTimestamp usage
URL: https://github.com/apache/rocketmq/issues/577
 
 
   为了使问题描述的更加清楚,我就在此使用中文啦。
   
   FlushRealTimeService中`lastFlushTimestamp`的用法有一些问题,`lastFlushTimestamp`应该意味着**最后一次刷盘的时间**。FlushRealTimeService刷盘的逻辑应该是:当在`flushPhysicQueueThoroughInterval`时间区间内没有任何数据刷盘(意味着没有数据,或者待刷盘的数据不足`flushPhysicQueueLeastPages`个内存页),此时会执行一次完全刷盘,即将`flushPhysicQueueLeastPages`设置为0,无论多少数据都会刷盘。
   
   上述的逻辑参考CommitRealTimeService的实现。
   
   https://github.com/apache/rocketmq/blob/1bedba8cbcef32554d2dc80f2a340ea686d68ba9/store/src/main/java/org/apache/rocketmq/store/CommitLog.java#L971-L994
   
   很显然,上述代码并不符合此逻辑。
   
   此外,`mappedFileQueue.getStoreTimestamp`获取最后刷盘时间,获取的时间也不准确。因为在异步刷盘时,`flushPhysicQueueLeastPages`可能不为0,即使如果有数据刷盘了`storeTimestamp`也不会被及时更新。
   
   https://github.com/apache/rocketmq/blob/1bedba8cbcef32554d2dc80f2a340ea686d68ba9/store/src/main/java/org/apache/rocketmq/store/MappedFileQueue.java#L434-L436

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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


With regards,
Apache Git Services