szetszwo commented on code in PR #662:
URL: https://github.com/apache/ratis/pull/662#discussion_r910227467
##########
ratis-server/src/main/java/org/apache/ratis/server/impl/ServerProtoUtils.java:
##########
@@ -90,7 +90,8 @@ static InstallSnapshotReplyProto toInstallSnapshotReplyProto(
RaftPeerId requestorId, RaftGroupMemberId replyId,
long currentTerm, InstallSnapshotResult result, long
installedSnapshotIndex) {
final RaftRpcReplyProto.Builder rb =
toRaftRpcReplyProtoBuilder(requestorId,
- replyId, result == InstallSnapshotResult.SUCCESS);
+ replyId, result == InstallSnapshotResult.SUCCESS ||
+ result == InstallSnapshotResult.SNAPSHOT_INSTALLED);
Review Comment:
Good catch! We should also add ALREADY_INSTALLED. Let's add a isSuccess
method
```
static boolean isSuccess(InstallSnapshotResult result) {
switch (result) {
case SUCCESS:
case SNAPSHOT_INSTALLED:
case ALREADY_INSTALLED:
return true;
default:
return false;
}
}
```
--
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]