szetszwo commented on code in PR #1597:
URL: https://github.com/apache/ratis/pull/1597#discussion_r4075614392
##########
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:
@amaliujia , Sorry, we add BatchLogKey.SNAPSHOT_EXPIRED and use it here.
##########
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:
@amaliujia , Sorry, we should add BatchLogKey.SNAPSHOT_EXPIRED and use it
here.
--
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]