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

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


The following commit(s) were added to refs/heads/master by this push:
     new a6719dc63 RATIS-1873. Remove RetryCache assertion that doesn't hold 
(#904)
a6719dc63 is described below

commit a6719dc63eb90cc6bdc622a0824101945e746475
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 add6b041d..a1645769c 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 @@ 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