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 2017/12/13 09:18:40 UTC

[GitHub] dongeforever commented on a change in pull request #189: [ROCKETMQ-270] Move flush position forward to first MappedFile whose start offset is non-zero

dongeforever commented on a change in pull request #189: [ROCKETMQ-270] Move flush position forward to first MappedFile whose start offset is non-zero
URL: https://github.com/apache/rocketmq/pull/189#discussion_r156599664
 
 

 ##########
 File path: store/src/main/java/org/apache/rocketmq/store/MappedFileQueue.java
 ##########
 @@ -421,7 +421,7 @@ public int deleteExpiredFileByOffset(long offset, int unitSize) {
 
     public boolean flush(final int flushLeastPages) {
         boolean result = true;
-        MappedFile mappedFile = this.findMappedFileByOffset(this.flushedWhere, false);
+        MappedFile mappedFile = this.findMappedFileByOffset(this.flushedWhere, this.flushedWhere == 0);
         if (mappedFile != null) {
 
 Review comment:
   findMappedFileByOffset should keep its semantic restriction.
   it is better to do like this:
   MappedFile mappedFile = this.findMappedFileByOffset(this.flushedWhere, false);
   if (mappedFile == null && this.flushedWhere == 0) {
      //revise the flush position, then find the file again
   }
   

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