diff --git a/ratis-server/src/main/java/org/apache/ratis/server/impl/RaftServerImpl.java b/ratis-server/src/main/java/org/apache/ratis/server/impl/RaftServerImpl.java index add6b041da..a1645769c3 100644 --- a/ratis-server/src/main/java/org/apache/ratis/server/impl/RaftServerImpl.java +++ b/ratis-server/src/main/java/org/apache/ratis/server/impl/RaftServerImpl.java @@ -1765,9 +1765,9 @@ private CompletableFuture replyPendingRequest( final ClientInvocationId invocationId = ClientInvocationId.valueOf(logEntry.getStateMachineLogEntry()); // update the retry cache final CacheEntry cacheEntry = retryCache.getOrCreateEntry(invocationId); - if (getInfo().isLeader()) { - Preconditions.assertTrue(cacheEntry != null && !cacheEntry.isCompletedNormally(), - "retry cache entry should be pending: %s", cacheEntry); + Preconditions.assertTrue(cacheEntry != null); + if (getInfo().isLeader() && !cacheEntry.isCompletedNormally()) { + LOG.warn("{} retry cache entry of leader should be pending: {}", this, cacheEntry); } if (cacheEntry.isFailed()) { retryCache.refreshEntry(new CacheEntry(cacheEntry.getKey()));