Skip to content

[Bug] Fix stale write timestamp leads to duplicate transaction commit #10199

@lizhimins

Description

@lizhimins

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

Linux 5.10

RocketMQ version

before 5.4.0

JDK Version

JDK11

Describe the Bug

OP消息落盘延迟导致事务回查机制异常:当OP消息写入耗时≥1ms且首次发送时间落在特定时间窗口时,会因lastWriteTimestamp计算问题导致两个3秒间隔叠加,造成6秒延迟,使得已提交消息被错误回查并重复提交。

Transaction check mechanism anomaly caused by OP message flush delay: When OP message write latency is ≥1ms and the first write timestamp falls within a specific time window, a calculation issue with lastWriteTimestamp causes two 3-second intervals to be stacked, resulting in a 6-second delay that leads to already-committed messages being incorrectly rechecked and duplicate commits.

Steps to Reproduce

Image

What Did You Expect to See?

Transaction check mechanism anomaly caused by OP message flush delay: When OP message write latency is ≥1ms and the first write timestamp falls within a specific time window, a calculation issue with lastWriteTimestamp causes two 3-second intervals to be stacked, resulting in a 6-second delay that leads to already-committed messages being incorrectly rechecked and duplicate commits.

What Did You See Instead?

No repeat

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions