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 2023/06/26 13:46:19 UTC
[GitHub] [pulsar] eolivelli commented on a diff in pull request #20649: [improve][broker] Avoid producer latency rise during internal ledger trimming operations
eolivelli commented on code in PR #20649:
URL: https://github.com/apache/pulsar/pull/20649#discussion_r1242212221
##########
managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedLedgerImpl.java:
##########
@@ -2451,11 +2451,11 @@ private void trimConsumedLedgersInBackground() {
@Override
public void trimConsumedLedgersInBackground(CompletableFuture<?> promise) {
- executor.execute(() -> internalTrimConsumedLedgers(promise));
+ scheduledExecutor.execute(() -> internalTrimConsumedLedgers(promise));
}
public void trimConsumedLedgersInBackground(boolean isTruncate, CompletableFuture<?> promise) {
- executor.execute(() -> internalTrimLedgers(isTruncate, promise));
+ scheduledExecutor.execute(() -> internalTrimLedgers(isTruncate, promise));
}
private void scheduleDeferredTrimming(boolean isTruncate, CompletableFuture<?> promise) {
Review Comment:
probably ew can also simplify this method `scheduleDeferredTrimming` and do not call scheduledExecutor twice
--
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