This is an automated email from the ASF dual-hosted git repository.
lhotari pushed a commit to branch branch-4.2
in repository https://gitbox.apache.org/repos/asf/pulsar.git
The following commit(s) were added to refs/heads/branch-4.2 by this push:
new 75fbe6b02ab [fix][ml] Fix eviction trigger race that cleared the
in-progress marker (#25988)
75fbe6b02ab is described below
commit 75fbe6b02ab1578b72458f4547f84ff5a42d130d
Author: Matteo Merli <[email protected]>
AuthorDate: Wed Jun 10 00:19:11 2026 -0700
[fix][ml] Fix eviction trigger race that cleared the in-progress marker
(#25988)
(cherry picked from commit fbcfacf324ef02c7c6fe639056fc7aa779262767)
---
.../bookkeeper/mledger/impl/cache/RangeEntryCacheManagerImpl.java | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git
a/managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/cache/RangeEntryCacheManagerImpl.java
b/managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/cache/RangeEntryCacheManagerImpl.java
index 6d048e11389..bcadb78b710 100644
---
a/managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/cache/RangeEntryCacheManagerImpl.java
+++
b/managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/cache/RangeEntryCacheManagerImpl.java
@@ -142,9 +142,9 @@ public class RangeEntryCacheManagerImpl implements
EntryCacheManager {
while (evictionCompletionFuture == null) {
evictionCompletionFuture = evictionInProgress.get();
if (evictionCompletionFuture == null) {
- evictionCompletionFuture = evictionInProgress.updateAndGet(
- currentValue -> currentValue == null ? new
CompletableFuture<>() : null);
- if (evictionCompletionFuture != null) {
+ CompletableFuture<Void> newEvictionFuture = new
CompletableFuture<>();
+ if (evictionInProgress.compareAndSet(null,
newEvictionFuture)) {
+ evictionCompletionFuture = newEvictionFuture;
triggerEvictionToMakeSpace(evictionCompletionFuture);
}
}