Tsz-wo Sze created RATIS-1902:
---------------------------------
Summary: The snapshot index is set incorrectly in
InstallSnapshotReplyProto
Key: RATIS-1902
URL: https://issues.apache.org/jira/browse/RATIS-1902
Project: Ratis
Issue Type: Bug
Components: server
Reporter: Tsz-wo Sze
Assignee: Tsz-wo Sze
{code}
// ServerProtoUtils.java
static InstallSnapshotReplyProto toInstallSnapshotReplyProto(
RaftPeerId requestorId, RaftGroupMemberId replyId,
long currentTerm, InstallSnapshotResult result, long
installedSnapshotIndex) {
final RaftRpcReplyProto.Builder rb = toRaftRpcReplyProtoBuilder(requestorId,
replyId, isSuccess(result));
final InstallSnapshotReplyProto.Builder builder = InstallSnapshotReplyProto
.newBuilder().setServerReply(rb).setTerm(currentTerm).setResult(result);
if (installedSnapshotIndex > 0) {
builder.setSnapshotIndex(installedSnapshotIndex);
}
return builder.build();
}
{code}
In the code above, the condition installedSnapshotIndex > 0 above is correct
since it cannot be set to RaftLog.INVALID_LOG_INDEX (== -1).
--
This message was sent by Atlassian Jira
(v8.20.10#820010)