Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

When delivery fails, there is an incorrect start offset in the delivery settings #9249

Copy link
Copy link
@coolmoon101

Description

@coolmoon101
Issue body actions

Before Creating the Bug Report

  • I found a bug, not just asking a question, which should be created in GitHub Discussions.

  • I have searched the GitHub Issues and GitHub Discussions of this repository and believe that this is not a duplicate.

  • I have confirmed that this bug belongs to the current repository, not other repositories of RocketMQ.

Runtime platform environment

mac

RocketMQ version

5.3.2

JDK Version

1.8

Describe the Bug

5.3.2 版本:
类:ScheduleMessageService.DeliverDelayedMessageTimerTask#executeOnTimeUp

ReferredIterator bufferCQ = cq.iterateFrom(this.offset);
long nextOffset = this.offset;
try {
while (bufferCQ.hasNext() && isStarted()) {
.......
long currOffset = cqUnit.getQueueOffset();
assert cqUnit.getBatchNum() == 1;
nextOffset = currOffset + cqUnit.getBatchNum();
......
boolean deliverSuc;
if (ScheduleMessageService.this.enableAsyncDeliver) {
deliverSuc = this.asyncDeliver(msgInner, msgExt.getMsgId(), currOffset, offsetPy, sizePy);
} else {
deliverSuc = this.syncDeliver(msgInner, msgExt.getMsgId(), currOffset, offsetPy, sizePy);
}

if (!deliverSuc) {
    this.scheduleNextTimerTask(nextOffset, DELAY_FOR_A_WHILE);
    return;
}

}

5.3.2 版本是否有问题。
投递失败时:this.scheduleNextTimerTask(nextOffset, DELAY_FOR_A_WHILE);
这里第一个参数是应该为 currOffset 吧

Steps to Reproduce

What Did You Expect to See?

What Did You See Instead?

if (!deliverSuc) {
this.scheduleNextTimerTask(currOffset, DELAY_FOR_A_WHILE);
return;
}

Additional Context

我对比了4.9.8的版本
类:ScheduleMessageService.DeliverDelayedMessageTimerTask#executeOnTimeUp

SelectMappedBufferResult bufferCQ = cq.getIndexBuffer(this.offset);
int i = 0;
ConsumeQueueExt.CqExtUnit cqExtUnit = new ConsumeQueueExt.CqExtUnit();
for (; i < bufferCQ.getSize() && isStarted(); i += ConsumeQueue.CQ_STORE_UNIT_SIZE) {
......
nextOffset = offset + (i / ConsumeQueue.CQ_STORE_UNIT_SIZE);
......
boolean deliverSuc;
if (ScheduleMessageService.this.enableAsyncDeliver) {
deliverSuc = this.asyncDeliver(msgInner, msgExt.getMsgId(), nextOffset, offsetPy, sizePy);
} else {
deliverSuc = this.syncDeliver(msgInner, msgExt.getMsgId(), nextOffset, offsetPy, sizePy);
}

if (!deliverSuc) {
    this.scheduleNextTimerTask(nextOffset, DELAY_FOR_A_WHILE);
    return;
}
......

}
在这里投递和投递失败时的处理都是使用的是 nextOffset

Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.