-
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
base: master
Are you sure you want to change the base?
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
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