From 185fb7aa34c01f7523ac04543618881aaedf7d72 Mon Sep 17 00:00:00 2001 From: szywilliam Date: Thu, 17 Aug 2023 16:59:13 +0800 Subject: [PATCH] remove assertion that doesn't hold --- .../java/org/apache/ratis/server/impl/RaftServerImpl.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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()));