[
https://issues.apache.org/jira/browse/ROCKETMQ-279?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16144713#comment-16144713
]
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_r135689182
--- Diff:
store/src/test/java/org/apache/rocketmq/store/ConsumeQueueTest.java ---
@@ -207,4 +226,34 @@ public void dispatch(DispatchRequest request) {
UtilAll.deleteFile(new File(storePath));
}
}
+
+ @Test
+ public void test_checkCommitLogAndConsumeQueueConsistent() throws
Exception {
+ DefaultMessageStore master = gen();
+
+ try {
+ master.getDispatcherList().addFirst(new CommitLogDispatcher() {
+
+ @Override
+ public void dispatch(DispatchRequest request) {
+ runCount++;
+ }
+
+ private int runCount = 0;
+ });
+
+ putMsg(master);
+ // wait build consume queue
+ Thread.sleep(2000);
+
+ ConsumeQueue cq =
master.getConsumeQueueTable().get(topic).get(queueId);
+ cq.checkCommitLogAndConsumeQueueConsistent();
--- End diff --
It seems that this test only covers the consistent condition?
> 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)