-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[fix][broker] Fix calculate avg message per entry #17046
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
Conversation
| // Note | ||
| // Must ensure that the message is written to the pendingAcks before sent is first, | ||
| // because this consumer is possible to disconnect at this time. | ||
| if (pendingAcks != null) { |
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.
Why move pendingAcks here ?
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.
Make sure the loop is executed.
21e1859 to
bfbfc3d
Compare
gaoran10
left a comment
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, but I'm not sure why the entry could be null. Do you know the reason?
Because some entries were set to pulsar/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/AbstractBaseDispatcher.java Line 98 in b1a29b5
|
codelipenghui
left a comment
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.
@coderzc The change looks good. Could you please help add a test? to avoid the regression in the future.
41efd83 to
bfbfc3d
Compare
ok, I have already added a test. |
eolivelli
left a comment
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
Good catch!
Please cherry pick to 2.10 branch
|
I don't think we need this in 2.9, filters don't exist there |
We need to cherry pick to 2.9 and 2.8, the same issue in |
|
Hi, @coderzc |
Yes, I will push a PR to branch-2.9. |
(cherry picked from commit 2c2b75e)
(cherry picked from commit 2c2b75e)
|
Remove from release 2.8.5. Since the original code is introduced in 2.9.3.#14666 |
Motivation
Calculating avg message per entry using
entries.size()is incorrect, because the entries may havenullvalues.Modifications
Calculate avg message per entry using the number of filter-out Non-null value total entries.
Documentation
Check the box below or label this PR directly.
Need to update docs?
doc-required(Your PR needs to update docs and you will update later)
doc-not-needed(Please explain why)
doc(Your PR contains doc changes)
doc-complete(Docs have been already added)