Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

mengnankkkk
Copy link

…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

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
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