lhotari opened a new pull request, #24125: URL: https://github.com/apache/pulsar/pull/24125
### Motivation Following up on #24089 changes. The changes cause a regression which is visible in branch-3.0 where a test fails (`org.apache.pulsar.compaction.CompactionTest#testDispatcherMaxReadSizeBytes`). This test is different in newer branches. The regression is caused by the logic added in #24089 to use `DEFAULT_ESTIMATED_ENTRY_SIZE + BOOKKEEPER_READ_OVERHEAD_PER_ENTRY` as the default average entry size. Another gap is that when all ledgers are empty, no average size would be used. That is also fixed in this PR ### Modifications - when the ledger is completely empty, don't estimate the number of entries, simply return 1 as the estimated entry count - when all ledgers are empty beyond the read position, find the latest ledger with entries to calculate the average entry count to be used in the estimation - add test coverage to cover these cases ### Documentation <!-- DO NOT REMOVE THIS SECTION. CHECK THE PROPER BOX ONLY. --> - [ ] `doc` <!-- Your PR contains doc changes. --> - [ ] `doc-required` <!-- Your PR changes impact docs and you will update later --> - [x] `doc-not-needed` <!-- Your PR changes do not impact docs --> - [ ] `doc-complete` <!-- Docs have been already added --> -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@pulsar.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org