You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@rocketmq.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2017/12/13 09:19:00 UTC

[jira] [Commented] (ROCKETMQ-270) Slave Broker can't start normally if master broker has been cleaned commit log

    [ https://issues.apache.org/jira/browse/ROCKETMQ-270?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16288940#comment-16288940 ] 

ASF GitHub Bot commented on ROCKETMQ-270:
-----------------------------------------

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


> Slave Broker can't start normally if master broker has been cleaned commit log
> ------------------------------------------------------------------------------
>
>                 Key: ROCKETMQ-270
>                 URL: https://issues.apache.org/jira/browse/ROCKETMQ-270
>             Project: Apache RocketMQ
>          Issue Type: Bug
>          Components: rocketmq-broker
>    Affects Versions: 4.0.0-incubating, 4.1.0-incubating
>            Reporter: yukon
>            Assignee: yukon
>             Fix For: 4.2.0
>
>
> How to reproduce this bug?
> 1. Start master broker, and write lots of messages until broker starts cleaning commit log.
> 2. When the first commit log file isn't 00000000000000, start slave broker.
> In current state, slave broker will pull messages from master broker, but the first message's offset isn't zero, and isn't equal to commit offset, so slave broker could't do right flush.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)