You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by "qianye1001 (via GitHub)" <gi...@apache.org> on 2026/08/18 02:45:08 UTC

[PR] [ISSUE #10953] Clamp shifted message count range to queue bounds [rocketmq]

qianye1001 opened a new pull request, #10954:
URL: https://github.com/apache/rocketmq/pull/10954

   ### Which Issue(s) This PR Fixes
   
   - Fixes #10953
   
   ### Brief Description
   
   `DefaultMessageStore.estimateMessageCount` shifts a filtered estimation range to the ConsumeQueue minimum offset when the requested lower bound has expired. The shifted upper bound was not constrained by the current maximum offset, so the range could extend beyond readable ConsumeQueue data. File-based ConsumeQueue scans could then emit `selectMappedBuffer request pos invalid` warnings and report a zero estimate without examining any entries.
   
   This change:
   
   - preserves the existing right-shift behavior and the requested interval length when space is available;
   - clamps both shifted endpoints to the current ConsumeQueue bounds;
   - truncates the shifted upper bound at `maxOffset` without overflowing;
   - returns zero when clamping produces an empty range.
   
   Regression tests cover a shifted range truncated at the maximum offset, a shifted range that preserves its full length, and a range that starts after the maximum offset.
   
   ### How Did You Test This Change?
   
   Ran with Amazon Corretto JDK 11:
   
   ```bash
   mvn -pl store "-Dtest=DefaultMessageStoreTest#testEstimateMessageCountShiftsRangeWithinQueueBounds+testEstimateMessageCountPreservesLengthWhenShiftedRangeFits+testEstimateMessageCountReturnsZeroWhenRangeIsAfterMaxOffset" test
   ```
   
   Result: 3 tests run, 0 failures, 0 errors, 0 skipped. The same Maven run also completed Checkstyle and SpotBugs with no violations or findings.
   


-- 
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: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [ISSUE #10953] Clamp shifted message count range to queue bounds [rocketmq]

Posted by "lollipopjin (via GitHub)" <gi...@apache.org>.
lollipopjin merged PR #10954:
URL: https://github.com/apache/rocketmq/pull/10954


-- 
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: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [ISSUE #10953] Clamp shifted message count range to queue bounds [rocketmq]

Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #10954:
URL: https://github.com/apache/rocketmq/pull/10954#issuecomment-5323148647

   ## [Codecov](https://app.codecov.io/gh/apache/rocketmq/pull/10954?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
   :white_check_mark: All modified and coverable lines are covered by tests.
   :white_check_mark: Project coverage is 48.52%. Comparing base ([`293f588`](https://app.codecov.io/gh/apache/rocketmq/commit/293f5885719fc4aa3619446a1900f58ccfcfdd29?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`4db8050`](https://app.codecov.io/gh/apache/rocketmq/commit/4db8050d7ea1fc8f50e3a2a4c8a479092b84ee84?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
   
   <details><summary>Additional details and impacted files</summary>
   
   
   
   ```diff
   @@              Coverage Diff              @@
   ##             develop   #10954      +/-   ##
   =============================================
   - Coverage      48.62%   48.52%   -0.10%     
   + Complexity     13693    13658      -35     
   =============================================
     Files           1381     1381              
     Lines         101464   101469       +5     
     Branches       13187    13189       +2     
   =============================================
   - Hits           49338    49241      -97     
   - Misses         46142    46212      +70     
   - Partials        5984     6016      +32     
   ```
   </details>
   
   [:umbrella: View full report in Codecov by Harness](https://app.codecov.io/gh/apache/rocketmq/pull/10954?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).   
   :loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
   <details><summary> :rocket: New features to boost your workflow: </summary>
   
   - :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
   </details>


-- 
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: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org