Drifter-yh commented on PR #11592: URL: https://github.com/apache/rocketmq/pull/11592#issuecomment-7121806912
Thanks for the careful review — both points are fair. On `msgAccCnt`: yes, it is the same "last message = highest offset" assumption. `Long.parseLong(property) - this.queueOffsetMax` after the loop is the correct value for an unordered batch. I kept this PR scoped to the next-offset bug, but I am happy to fold it in here or send a follow-up — your call. On the real path: I want to be precise rather than overstate the impact. I could not find a production path where a single pulled batch is unordered. The normal pull path decodes consume-queue entries in ascending order (`MessageDecoder.decodesBatch` preserves order), inner-batch unwrapping assigns `base + i`, pop mode uses `PopProcessQueue` and never calls `putMessage`, and offset reset removes the `ProcessQueue`. So the repro is a unit test, and I treat this as defensive hardening of the invariant, not an observed production failure. The only way to hand `putMessage` an unordered list is an embedding/custom caller (for example a `FilterMessageHook` that reorders entries, or code calling `putMessage` directly). I have added that scope note to the PR description so the impact is not overstated. If you think defensive-only is not sufficient justification, let me know; otherwise the one-line change keeps `removeMessage` correct regardless of caller ordering. -- 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]
