RongtongJin commented on code in PR #4797:
URL: https://github.com/apache/rocketmq/pull/4797#discussion_r939933737
##########
store/src/main/java/org/apache/rocketmq/store/queue/ConsumeQueueStore.java:
##########
@@ -341,6 +343,50 @@ private void putConsumeQueue(final String topic, final int
queueId, final Consum
}
}
+ public void truncateTimerConsumerOffset(TimerMessageStore
timerMessageStore) {
+ if (this.consumeQueueTable.get(TimerMessageStore.TIMER_TOPIC) == null
+ ||
this.consumeQueueTable.get(TimerMessageStore.TIMER_TOPIC).get(0) == null) {
+ return;
+ }
+ ConsumeQueueInterface consumerQueue =
this.consumeQueueTable.get(TimerMessageStore.TIMER_TOPIC).get(0);
+ if (timerMessageStore.getQueueOffset() >
consumerQueue.getMaxOffsetInQueue()) {
+
timerMessageStore.setQueueOffset(consumerQueue.getMaxOffsetInQueue());
+ }
+ }
Review Comment:
It would be better to handle timer consumer offset separately in
timerMessageStore.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]