-
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
[improve] [broker] Make the estimated entry size more accurate #23931
Conversation
After #23901 changes this case would be very rare since it would apply only for the first read in case no entries were produced to the topic. |
Agree, but for the following case, the current solution is better
|
/pulsarbot rerun-failure-checks |
87602ba
to
30646c0
Compare
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.
The change looks good, left a minor comments about this test change.
pulsar-broker/src/test/java/org/apache/pulsar/broker/stats/ConsumerStatsTest.java
Outdated
Show resolved
Hide resolved
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #23931 +/- ##
============================================
+ Coverage 73.57% 74.20% +0.63%
+ Complexity 32624 32357 -267
============================================
Files 1877 1856 -21
Lines 139502 144162 +4660
Branches 15299 16415 +1116
============================================
+ Hits 102638 106982 +4344
+ Misses 28908 28765 -143
- Partials 7956 8415 +459
Flags with carried forward coverage won't be shown. Click here to find out more.
|
@poorbarcode Great work, Yubiao! I can backport and cherry-pick this to branch-3.3 and branch-3.0. |
(cherry picked from commit 35a1676)
(cherry picked from commit 35a1676)
(cherry picked from commit 35a1676)
apache#23931)" This reverts commit 42aab41.
Motivation
Background
B1
: Broker assumes the entry size is1
when no publishing after the topic was loaded up at the latest time. Otherwise, it uses the average entries size published during the lastest time-range of the topic loaded up.B2
: The featuremanagedLedgerMaxReadsInFlightSize
assumes the entry size is10kb
when it read nothing. Otherwise, it uses the average entries size of the entries read out before.Issue
Regarding scenario
B2
, it may cause an errorTime-out elapsed while acquiring enough permits on the memory limiter to read from ledger 33, {tenant}/{ns}/persistent/{topic}-partition-0, estimated read size 1937 bytes for 1 entries (check managedLedgerMaxReadsInFlightSizeInMB)
when there is hundreds topic being read and the exact entry size is very little.More accurate solutions
P0
: Use the exact size of the entries that we attempt to read.P1
: Use the exact size of the ledger that the entries were stored at to estimate the entries' size.P2
: Use the size of the topic that the entries were stored at to estimate the entries' size.Modifications
P2
solution, change the solution toP1
, and it will never return an inaccurate value such as1
or10k
Documentation
doc
doc-required
doc-not-needed
doc-complete
Matching PR in forked repository
PR in forked repository: x