Github user zhouxinyu commented on a diff in the pull request:

    https://github.com/apache/incubator-rocketmq/pull/159#discussion_r135688453
  
    --- Diff: store/src/main/java/org/apache/rocketmq/store/ConsumeQueue.java 
---
    @@ -84,6 +84,59 @@ public boolean load() {
             return result;
         }
     
    +    public void checkCommitLogAndConsumeQueueConsistent() {
    +
    +        String queueDir = this.storePath
    +            + File.separator + topic
    +            + File.separator + queueId + File.separator;
    +
    +        long maxOffsetInQueue = getMaxOffsetInQueue();
    --- End diff --
    
    I would like to use `long lastRecordOffset = getMaxOffsetInQueue();` 
instead, to avoid using too many `+1 or -1` in below code block. Actually, 
`getMaxOffsetInQueue()` returns the next write position, not the position of 
last consume queue record.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to