Skip to content

[ISSUE 9535]: Prevent first message loss in CONSUME_FROM_LAST_OFFSET #7187#9552

Closed
mengnankkkk wants to merge 4 commits intoapache:developfrom
mengnankkkk:fix-9535
Closed

[ISSUE 9535]: Prevent first message loss in CONSUME_FROM_LAST_OFFSET #7187#9552
mengnankkkk wants to merge 4 commits intoapache:developfrom
mengnankkkk:fix-9535

Conversation

@mengnankkkk
Copy link
Copy Markdown

…empty/single-message queues #9535

Which Issue(s) This PR Fixes

When maxOffset <= 1, start from offset 0 to ensure no messages are skipped
maxOffset = 0: empty queue, start from 0 (no messages to consume)
maxOffset = 1: single message at offset 0, start from 0 to consume it
maxOffset > 1: multiple messages, start from maxOffset (last position)

Fixes #9535

Brief Description

How Did You Test This Change?

Added 8 new test methods to the existing RebalancePushImplTest class to test various edge cases of the maxOffset method.

@mengnankkkk mengnankkkk changed the title [ISSUE 9535]: Prevent first message loss in CONSUME_FROM_LAST_OFFSET [ISSUE 9535]: Prevent first message loss in CONSUME_FROM_LAST_OFFSET#7187 Jul 17, 2025
@mengnankkkk mengnankkkk changed the title [ISSUE 9535]: Prevent first message loss in CONSUME_FROM_LAST_OFFSET#7187 [ISSUE 9535]: Prevent first message loss in CONSUME_FROM_LAST_OFFSET #7187 Jul 17, 2025
@codecov-commenter
Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 80.00000% with 1 line in your changes missing coverage. Please review.

Project coverage is 48.00%. Comparing base (40e3aa9) to head (8f48022).
Report is 1 commits behind head on develop.

Files with missing lines Patch % Lines
...cketmq/client/impl/consumer/RebalancePushImpl.java 80.00% 1 Missing ⚠️
Additional details and impacted files
@@              Coverage Diff              @@
##             develop    #9552      +/-   ##
=============================================
- Coverage      48.12%   48.00%   -0.13%     
+ Complexity     12067    12040      -27     
=============================================
  Files           1313     1313              
  Lines          92767    92770       +3     
  Branches       11862    11863       +1     
=============================================
- Hits           44647    44530     -117     
- Misses         42625    42728     +103     
- Partials        5495     5512      +17     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@mengnankkkk mengnankkkk changed the title [ISSUE 9535]: Prevent first message loss in CONSUME_FROM_LAST_OFFSET #7187 [ISSUE 9535]: Prevent first message loss in CONSUME_FROM_LAST_OFFSET #7187 Jul 30, 2025
@mengnankkkk mengnankkkk deleted the fix-9535 branch August 23, 2025 11:14
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] topic首次创建时,实例无法消费消息

2 participants