Repository navigation
[improve] [ml] compress individual ack info to make maintain more records - #21105
poorbarcode wants to merge 2 commits into
Conversation
|
The pr had no activity for 30 days, mark with Stale label. |
lhotari
left a comment
There was a problem hiding this comment.
Please extract the logic to a separate class which is unit tested separately.
| @VisibleForTesting | ||
| List<MLDataFormats.MessageRange> buildIndividualDeletedMessageRanges() { |
There was a problem hiding this comment.
Instead of adding "VisibleForTesting" annotation here, please extract this logic to a separate class which is tested separately. There's a lot of complexity here and this would be very hard to maintain in the future in this form. Smaller classes and smaller methods are a general preference in maintainable code.
|
Hi @poorbarcode, thanks for the contribution. The review asked to extract the merging logic into a separate class with its own unit tests, and the PR was left unfinished after that. ManagedCursorImpl has changed a lot since, and master now persists up to 200000 unacked ranges by default with LZ4 compression of the cursor info, so this would need a fresh start. We're going through the backlog of open PRs (https://lists.apache.org/thread/cgy7w0qgnq8s7j0ykyzgrn3hj4nb67wf), so I'm closing this one. If you'd like to continue, feel free to reopen it rebased on current master. |
Motivation
Broker serialize
individualDeletedMessagesas an array(1:1..1:5000],(2:-1..3:5000],,(100:-1..100:5000], each ledger will have a separate record, even if multiple ledgers are contiguous.We can compress the contiguous records to one, such as
(1:1...100:5000]. This can make one entry maintain more data, it also saves the IO of persisting cursor ack statsModifications
Compress the contiguous records to one to make one entry maintain more data.
Next to do: push another PR to compress the response of
pulsar-admin topics stats.In what cases would it be useful
(Highlight) Note: This patch will have a big impact and needs to be cherry-picked and reviewed carefully.
Documentation
docdoc-requireddoc-not-neededdoc-completeMatching PR in forked repository
PR in forked repository: x