szetszwo commented on code in PR #868:
URL: https://github.com/apache/ratis/pull/868#discussion_r1152800541


##########
ratis-server/src/main/java/org/apache/ratis/server/impl/ServerState.java:
##########
@@ -441,7 +441,9 @@ void installSnapshot(InstallSnapshotRequestProto request) 
throws IOException {
     StateMachine sm = server.getStateMachine();
     sm.pause(); // pause the SM to prepare for install snapshot
     snapshotManager.installSnapshot(request, sm);
-    
updateInstalledSnapshotIndex(TermIndex.valueOf(request.getSnapshotChunk().getTermIndex()));
+    if (request.getSnapshotChunk().getDone()) {
+      
updateInstalledSnapshotIndex(TermIndex.valueOf(request.getSnapshotChunk().getTermIndex()));
+    }

Review Comment:
   @kaijchen , thanks a lot for working on this!  Let's combine 
`updateInstalledSnapshotIndex` with `reloadStateMachine`; see 
https://issues.apache.org/jira/secure/attachment/13056909/868_review.patch



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