Skip to content

[ISSUE #11180] Reject wrapped POP ACK offsets - #11181

Open
beautyarbutin wants to merge 1 commit into
apache:developfrom
beautyarbutin:fix/pop-ack-offset-overflow
Open

beautyarbutin wants to merge 1 commit into
apache:developfrom
beautyarbutin:fix/pop-ack-offset-overflow

Conversation

@beautyarbutin

@beautyarbutin beautyarbutin commented Sep 19, 2026

Copy link
Copy Markdown

Which Issue(s) This PR Fixes

Brief Description

PopCheckPoint.indexOfAck narrowed the difference between an ACK offset and the checkpoint start offset from long to int before matching it against queueOffsetDiff. A difference larger than Integer.MAX_VALUE could therefore wrap to a valid popped-message offset and acknowledge the wrong checkpoint entry.

Keep the difference as a long, reject negative or non-representable values before narrowing, and add a regression test covering normal, before-start, and wrapped ACK offsets.

How Did You Test This Change?

  • mvn -B -pl store -am -DskipITs -Dtest=PopCheckPointTest -Dsurefire.failIfNoSpecifiedTests=false test
    • 2 tests, 0 failures, 0 errors
  • mvn -B -pl store -am -DskipITs test
    • Store module: 329 tests, 0 failures, 0 errors, 18 skipped
    • Reactor build, Checkstyle, and SpotBugs passed

@RockteMQ-AI RockteMQ-AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Small change, looks good.


Automated review by github-manager-bot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] POP checkpoint accepts wrapped ACK offsets outside the popped batch

2 participants