-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
[fix][broker] Fix skip message API when hole messages exists #20326
Conversation
managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedCursorImpl.java
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@poorbarcode @Technoboy- Please help take a look, thanks. 😸 |
Codecov Report
@@ Coverage Diff @@
## master #20326 +/- ##
=============================================
+ Coverage 37.92% 72.38% +34.45%
- Complexity 12694 32022 +19328
=============================================
Files 1691 1867 +176
Lines 129047 143534 +14487
Branches 14070 16439 +2369
=============================================
+ Hits 48942 103897 +54955
+ Misses 73777 31250 -42527
- Partials 6328 8387 +2059
Flags with carried forward coverage won't be shown. Click here to find out more.
|
@@ -1779,7 +1779,6 @@ long getNumIndividualDeletedEntriesToSkip(long numEntries) { | |||
} finally { | |||
if (r.lowerEndpoint() instanceof PositionImplRecyclable) { | |||
((PositionImplRecyclable) r.lowerEndpoint()).recycle(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@crossoverJie @liangyepianzhou I have a question about this change.
issue #20262 description contains "The reason for this issue is that the recycle() function reuses objects, causing the object referenced by r to change during runtime."
What is the reason that the lowerEndpoint is recycled and the upperEndpoint isn't?
why not just skip recycling completely? Omitting recycling completely would be fine if recycling is problematic.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We recycle an object after it is no longer used to save GC pause.
But the upperEndpoint is still used after being recycled, which makes this issue.
The lowerEndpoint is no longer used after being recycled, so we can recycle it.
state.startPosition = r.upperEndpoint();
(cherry picked from commit c35b820)
(cherry picked from commit c35b820)
(cherry picked from commit c35b820)
As discussed on the mailing list https://lists.apache.org/thread/w4jzk27qhtosgsz7l9bmhf1t7o9mxjhp, there is no plan to release 2.9.6, so I am going to remove the release/2.9.6 label |
Fixes #20262
Motivation
When there are hole messages, there is a bug in the API of skipping the message, please refer to the issue for the specific reason
Modifications
Remove
recyclePositionRangeConverter
, revert to normal loop.Verifying this change
Does this pull request potentially affect one of the following parts:
If the box was checked, please highlight the changes
Documentation
doc
doc-required
doc-not-needed
doc-complete
Matching PR in forked repository
PR in forked repository: (crossoverJie#8)