-
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] refactor ManagedLedger cacheEvictionTask implement #14488
Conversation
@aloyszhang:Thanks for your contribution. For this PR, do we need to update docs? |
@aloyszhang:Thanks for providing doc info! |
pulsar-broker-common/src/main/java/org/apache/pulsar/broker/ServiceConfiguration.java
Outdated
Show resolved
Hide resolved
Hi @aloyszhang Do we have an email discussion for the new configuration? Please add the discussion link to the PR description, so that we can push forward this PR. |
@codelipenghui , Sorry for being late, I have sent the discussion email right now. Discuss thread: https://lists.apache.org/thread/wryzorp7jt6511jt25cv7mss4lz3r1bt |
/pulsarbot run-failure-checks |
pulsar-broker-common/src/main/java/org/apache/pulsar/broker/ServiceConfiguration.java
Outdated
Show resolved
Hide resolved
managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedLedgerFactoryImpl.java
Outdated
Show resolved
Hide resolved
pulsar-broker/src/main/java/org/apache/pulsar/broker/ManagedLedgerClientFactory.java
Outdated
Show resolved
Hide resolved
/pulsarbot run-failure-checks |
The pr had no activity for 30 days, mark with Stale label. |
The pr had no activity for 30 days, mark with Stale label. |
/pulsarbot run-failure-checks |
It would be good to fix #16054 before changing the cache. |
/pulsarbot run-failure-checks |
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.
LGTM, I left some little questions. I hope you can answer.
pulsar-broker-common/src/main/java/org/apache/pulsar/broker/ServiceConfiguration.java
Show resolved
Hide resolved
pulsar-broker-common/src/main/java/org/apache/pulsar/broker/ServiceConfiguration.java
Outdated
Show resolved
Hide resolved
pulsar-broker/src/test/java/org/apache/pulsar/client/api/ConsumerRedeliveryTest.java
Show resolved
Hide resolved
pulsar-broker/src/test/java/org/apache/pulsar/client/api/PartitionCreationTest.java
Show resolved
Hide resolved
/pulsarbot run-failure-checks |
Was this discussed on the mailing list? I did a quick search and couldn't find a thread on the topic. It's especially important to give this PR visibility because it changed the names of configuration in a breaking way.
@aloyszhang - did you benchmark this change? I thought the previous implementation was intentionally designed to decrease GC overhead. |
@aloyszhang I was just trying to get the most critical problem of the broker cache (#16054) fixed before we do any other changes. I have now pushed a fix in #17273 . Please review since it should make a difference for heavy users of Pulsar. |
Motivation
Current the
cacheEvictionTask
pulsar/managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedLedgerFactoryImpl.java
Line 255 in 4532c15
will be executed periodically, the period is calculated by
And this task will be executed once and then sleep
waitTimeMillis
before the next round.We can do some optimizes for this logic.
Modifications
managedLedgerCacheEvictionIntervalMs
ScheduledExecutorService
to execute the cache eviction task everymanagedLedgerCacheEvictionIntervalMs
Verifying this change
This change is already covered by existing tests, such as (please describe tests).
Does this pull request potentially affect one of the following parts:
If
yes
was chosen, please highlight the changesDocumentation
no-need-doc
(Please explain why)