You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@rocketmq.apache.org by GitBox <gi...@apache.org> on 2021/09/23 03:45:17 UTC

[GitHub] [rocketmq] RongtongJin commented on a change in pull request #3358: [ISSUE #1869] Delay message can't be consumed when delay offset in delayOffset.json is wrong

RongtongJin commented on a change in pull request #3358:
URL: https://github.com/apache/rocketmq/pull/3358#discussion_r714451968



##########
File path: store/src/main/java/org/apache/rocketmq/store/schedule/ScheduleMessageService.java
##########
@@ -376,10 +408,17 @@ public void executeOnTimeup() {
                 else {
 
                     long cqMinOffset = cq.getMinOffsetInQueue();
+                    long cqMaxOffset = cq.getMaxOffsetInQueue();
                     if (offset < cqMinOffset) {
                         failScheduleOffset = cqMinOffset;
-                        log.error("schedule CQ offset invalid. offset=" + offset + ", cqMinOffset="
-                            + cqMinOffset + ", queueId=" + cq.getQueueId());
+                        log.error("schedule CQ offset invalid. offset={}, cqMinOffset={}, cqMaxOffset={}, queueId={}",
+                            offset, cqMinOffset, cqMaxOffset, cq.getQueueId());
+                    }
+
+                    if (offset > cqMaxOffset) {
+                        failScheduleOffset = cqMaxOffset;
+                        log.error("schedule CQ offset invalid. offset={}, cqMinOffset={}, cqMaxOffset={}, queueId={}",
+                            offset, cqMinOffset, cqMaxOffset, cq.getQueueId());

Review comment:
       When offset > cqMaxOffset  failScheduleOffset = cqMaxOffset, when offset < cqMinOffset  failScheduleOffset = cqMinOffset. In general, failscheduleoffset = offset. So all relevant offset values have been printed in the current log. There is no need to print failScheduleOffset at last.




-- 
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: dev-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org