This is an automated email from the ASF dual-hosted git repository.

williamsong pushed a commit to branch snapshot-branch2
in repository https://gitbox.apache.org/repos/asf/ratis.git

commit 209bbe232b89bd9418da7c16d6e7ad3f9e41a40f
Author: William Song <[email protected]>
AuthorDate: Fri Aug 18 22:28:01 2023 +0800

    RATIS-1873. Remove RetryCache assertion that doesn't hold (#904)
---
 .../src/main/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 341890588..3eaf2dc6c 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
@@ -1730,9 +1730,9 @@ class RaftServerImpl implements RaftServer.Division,
     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()));

Reply via email to