-
Notifications
You must be signed in to change notification settings - Fork 909
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] DigestManager should not advance readerIndex #3919
[fix] DigestManager should not advance readerIndex #3919
Conversation
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.
Great catch!
@hangc0276 this is a bad regression we should cut a new release ASAP
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
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.
Nice Catch!
How this bug happens on the Pulsar sideReproduce steps
How this bug happens
|
@eolivelli Sure, I will cut 4.16.1 that just include this PR soon. |
(cherry picked from commit df44920)
Descriptions of the changes in this PR:
#3783 introduced a change in the behavior of
LedgerHandle#asyncAddEntry
. This PR re-introduces the original behavior.Motivation
Apache Pulsar just upgraded to Bookkeeper client version 4.16.0. In doing so, we observed new errors related to unexpected reader positions in the passed in byte buffer. Here is a thread discussing some of the observations: https://lists.apache.org/thread/n4dpmbo5t9bvq5t1fp8fn4m6c6d9d9so.
Based on my analysis, it seems that the core issue is with the type of
ByteBuf
being passed to the BK client. Previously, thereaderIndex
for theByteBuf
that was passed did not change. Now, it seems to move forward. I am assuming this is because of specific conditions related toCompositeByteBuf
, but I haven't yet been able to create a test to show the problem. Perhaps someone is more familiar with these data structures and can provide me with insight into how to test this change?Changes
Update
DigestManager#computeDigestAndPackageForSendingV2
in the case of a small entry to use a copy method that does not modify thereaderIndex
on the parameterized buffer.Below are the Javadocs for the old and the new method.