[
https://issues.apache.org/jira/browse/ROCKETMQ-279?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16144707#comment-16144707
]
ASF GitHub Bot commented on ROCKETMQ-279:
-----------------------------------------
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.
> add commit log data and consume queue data logic consistent check when start
> mq
> -------------------------------------------------------------------------------
>
> Key: ROCKETMQ-279
> URL: https://issues.apache.org/jira/browse/ROCKETMQ-279
> Project: Apache RocketMQ
> Issue Type: Bug
> Components: rocketmq-store
> Affects Versions: 4.0.0-incubating, 4.1.0-incubating
> Reporter: yubaofu
> Assignee: yukon
> Fix For: 4.2.0-incubating
>
>
> commit log and consume data may logic inconsistent ,
> because [ROCKETMQ-265|https://issues.apache.org/jira/browse/ROCKETMQ-265],
> so we add data consistent check,when mq start.
> if check failed, start failed.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)