ymwneu opened a new pull request, #10960: URL: https://github.com/apache/rocketmq/pull/10960
fix: RocksDBConsumeQueue.iterateFrom should reject offset below min offset startIndex < minOffset was previously accepted as long as it stayed within [0, maxOffset), returning a non-null LargeRocksDBConsumeQueueIterator whose next() can yield a null CqUnit once the underlying data has been purged. Callers like ScheduleMessageService rely on iterateFrom returning null to detect and correct an out-of-range offset (matching ConsumeQueue's getMinLogicOffset() check); without it they NPE dereferencing the null CqUnit instead. Add the same startIndex >= getMinOffsetInQueue() bound used by the file-based ConsumeQueue to both iterateFrom overloads. <!-- Please make sure the target branch is right. In most case, the target branch should be `develop`. --> ### Which Issue(s) This PR Fixes <!-- Please ensure that the related issue has already been created, and [link this pull request to that issue using keywords](<https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword>) to ensure automatic closure. --> - Fixes #10959 ### Brief Description <!-- Write a brief description for your pull request to help the maintainer understand the reasons behind your changes. --> ### How Did You Test This Change? <!-- In order to ensure the code quality of Apache RocketMQ, we expect every pull request to have undergone thorough testing. --> -- 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]
