hanishakoneru commented on a change in pull request #88:
URL: https://github.com/apache/incubator-ratis/pull/88#discussion_r421126675



##########
File path: 
ratis-grpc/src/main/java/org/apache/ratis/grpc/server/GrpcLogAppender.java
##########
@@ -394,17 +403,19 @@ public void onNext(InstallSnapshotReplyProto reply) {
     @Override
     public void onError(Throwable t) {
       if (!isAppenderRunning()) {
-        LOG.info("{} is stopped", this);
+        LOG.info("{} is stopped", GrpcLogAppender.this);
         return;
       }
-      LOG.error("{}: Failed installSnapshot: {}", this, t);
+      GrpcUtil.warn(LOG, () -> this + ": Failed InstallSnapshot", t);
+      grpcServerMetrics.onRequestRetry(); // Update try counter
       resetClient(null);
-      close();
     }
 
     @Override
     public void onCompleted() {
-      LOG.info("{}: follower responses installSnapshot COMPLETED", this);
+      if (!firstResponseReceived) {

Review comment:
       I had added it as otherwise the Log is flooded with "InstallSnapshot 
COMPLETED" messages even when the install snapshot is in progress. I updated it 
to not print in case of install snapshot notification.

##########
File path: 
ratis-grpc/src/main/java/org/apache/ratis/grpc/server/GrpcLogAppender.java
##########
@@ -369,13 +369,22 @@ public void onNext(InstallSnapshotReplyProto reply) {
 
       switch (reply.getResult()) {
         case SUCCESS:
+          LOG.info("{}: Completed InstallSnapshot. Reply: {}", this);
+          removePending(reply);
+          break;
+        case NOTIFIED:
+          LOG.info("{}: Notified to InstallSnapshot.", this);
+          removePending(reply);
+          break;
         case IN_PROGRESS:
+          LOG.info("{}: InstallSnapshot in progress.", this);
           removePending(reply);
           break;
         case ALREADY_INSTALLED:
           final long followerSnapshotIndex = reply.getSnapshotIndex();
-          LOG.info("{}: set follower snapshotIndex to {}.", this, 
followerSnapshotIndex);
+          LOG.info("{}: Already Installed Snapshot Index {}.", this, 
followerSnapshotIndex);
           getFollower().setSnapshotIndex(followerSnapshotIndex);
+          updateCommitIndex(followerSnapshotIndex);

Review comment:
       Done.

##########
File path: 
ratis-grpc/src/main/java/org/apache/ratis/grpc/server/GrpcLogAppender.java
##########
@@ -369,13 +369,22 @@ public void onNext(InstallSnapshotReplyProto reply) {
 
       switch (reply.getResult()) {
         case SUCCESS:
+          LOG.info("{}: Completed InstallSnapshot. Reply: {}", this);

Review comment:
       Done.

##########
File path: 
ratis-grpc/src/main/java/org/apache/ratis/grpc/server/GrpcLogAppender.java
##########
@@ -369,13 +369,22 @@ public void onNext(InstallSnapshotReplyProto reply) {
 
       switch (reply.getResult()) {
         case SUCCESS:
+          LOG.info("{}: Completed InstallSnapshot. Reply: {}", this);
+          removePending(reply);
+          break;
+        case NOTIFIED:

Review comment:
       Agree. Done.




----------------------------------------------------------------
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.

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


Reply via email to