duhengforever commented on a change in pull request #501: [ISSUE #467] fix 
Message missed after recovering from abnormal shutdown
URL: https://github.com/apache/rocketmq/pull/501#discussion_r229571615
 
 

 ##########
 File path: store/src/main/java/org/apache/rocketmq/store/CommitLog.java
 ##########
 @@ -206,6 +208,12 @@ else if (!dispatchRequest.isSuccess()) {
             this.mappedFileQueue.setFlushedWhere(processOffset);
             this.mappedFileQueue.setCommittedWhere(processOffset);
             this.mappedFileQueue.truncateDirtyFiles(processOffset);
+
+            // Clear ConsumeQueue redundant data
+            if (isDamaged && maxPhyOffsetOfConsumeQueue >= processOffset) {
 
 Review comment:
   It will be better if you can abstract this truncate logic and put it in the 
recover() method, because this problem exists no matter it is normal recovery 
or abnormal recovery.
   
   

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to