You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by "eolivelli (via GitHub)" <gi...@apache.org> on 2024/04/30 12:42:09 UTC

[PR] [improve][storage] Periodically rollover Cursor ledgers [pulsar]

eolivelli opened a new pull request, #22622:
URL: https://github.com/apache/pulsar/pull/22622

   ### Motivation
   
   Each ManagedCursor stores its own status on a BookKeeper ledger and this ledger is rolled over when one of these conditions are met: some time passed or too many entries have been written.
   
   The problem is that the condition is checked only while writing to the ledger: if no consumer sends acknowledgments then the ledger is never rolled over.
   This may become a problem because there will be a long lived ledger that doesn't respect the configuration set by the administrator for "ledger rollover".
   Creating a new ledger allows the Bookies to reclaim space, especially thanks to the GC (Garbage collection) mechanism, and then with the Compaction.
   Having a long lived ledger prevents the Bookie to release disk space promplty with the GC, and so only Compaction can release space, but compaction is an expensive operation.
   For this reason in some usecases you want to configure a frequent rollover of the ledgers for the topics, and thus you want that such rollover happens at the same frequency also for the cursor ledgers.
   
   ### Modifications
   
   This patch simply allows the broker to periodically check every ManagedCursor and apply the rollover configuration even when there is no consumer activity. 
   
   ### Verifying this change
   
   This change added tests
   
   ### Does this pull request potentially affect one of the following parts:
   
   <!-- DO NOT REMOVE THIS SECTION. CHECK THE PROPER BOX ONLY. -->
   
   *If the box was checked, please highlight the changes*
   
   - [ ] Dependencies (add or upgrade a dependency)
   - [ ] The public API
   - [ ] The schema
   - [ ] The default values of configurations
   - [ ] The threading model
   - [ ] The binary protocol
   - [ ] The REST endpoints
   - [ ] The admin CLI options
   - [ ] The metrics
   - [ ] Anything that affects deployment
   
   ### 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 -->
   
   ### Matching PR in forked repository
   
   PR in forked repository: https://github.com/eolivelli/pulsar/pull/26
   
   <!--
   After opening this PR, the build in apache/pulsar will fail and instructions will
   be provided for opening a PR in the PR author's forked repository.
   
   apache/pulsar pull requests should be first tested in your own fork since the 
   apache/pulsar CI based on GitHub Actions has constrained resources and quota.
   GitHub Actions provides separate quota for pull requests that are executed in 
   a forked repository.
   
   The tests will be run in the forked repository until all PR review comments have
   been handled, the tests pass and the PR is approved by a reviewer.
   -->
   


-- 
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-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [improve][storage] Periodically rollover Cursor ledgers [pulsar]

Posted by "eolivelli (via GitHub)" <gi...@apache.org>.
eolivelli merged PR #22622:
URL: https://github.com/apache/pulsar/pull/22622


-- 
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-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [improve][storage] Periodically rollover Cursor ledgers [pulsar]

Posted by "thetumbled (via GitHub)" <gi...@apache.org>.
thetumbled commented on PR #22622:
URL: https://github.com/apache/pulsar/pull/22622#issuecomment-2085358580

   LGTM. 
   I agree that we should find out the long live ledgers and shorten their lifecycle, so that we do not need to speed lots of effort on compaction. 
   According to my finding, the space reclaimed by compaction take up a large part of the total space reclaimed, which will spend lots of I/O resource. We should increase the ratio of space reclaimed by deleting the entire entry log.


-- 
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-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org