amaliujia commented on code in PR #1597:
URL: https://github.com/apache/ratis/pull/1597#discussion_r4080692627


##########
ratis-grpc/src/main/java/org/apache/ratis/grpc/server/GrpcLogAppender.java:
##########
@@ -775,27 +775,26 @@ public void onNext(InstallSnapshotReplyProto reply) {
           removePending(reply);
           break;
         case SNAPSHOT_UNAVAILABLE:
-          BatchLogger.print(BatchLogKey.SNAPSHOT_UNAVAILABLE,  name,
-              suffix -> LOG.info("{}: Follower failed since the snapshot is 
unavailable {}", this, suffix));
-          getFollower().setAttemptedToInstallSnapshot();
-          
notifyInstallSnapshotFinished(InstallSnapshotResult.SNAPSHOT_UNAVAILABLE, 
RaftLog.INVALID_LOG_INDEX);
-          removePending(reply);
-          break;
-        case UNRECOGNIZED:
-          LOG.error("{}: Reply result {}, {}",
-              name, reply.getResult(), 
ServerStringUtils.toInstallSnapshotReplyString(reply));
+          handleFailureReply(reply, BatchLogKey.SNAPSHOT_UNAVAILABLE);
           break;
         case SNAPSHOT_EXPIRED:
-          LOG.warn("{}: Follower failed since the request expired, {}",
-              name, ServerStringUtils.toInstallSnapshotReplyString(reply));
-          getFollower().setAttemptedToInstallSnapshot();
-          removePending(reply);
+          handleFailureReply(reply, BatchLogKey.SNAPSHOT_UNAVAILABLE);

Review Comment:
   Ah I see. 
   
   The suggestion didn't include unify `expired` case into 
`BatchLogKey.SNAPSHOT_UNAVAILABLE`
   
   Added the dedicated log key for `expired` now.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to