X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-akka-raft%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fcluster%2Fraft%2Fbehaviors%2FLeaderInstallSnapshotState.java;h=3b4c7d813309a3ddb0b03520ebf1254623578339;hp=5d47dbd02ec9754e94e5bf0f3c81e1a769caf6ba;hb=8049fd4d06da0f4616180e46fbbe95f98cf698ea;hpb=244a736539cb2244f74aca5de58943adbb969b60 diff --git a/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/behaviors/LeaderInstallSnapshotState.java b/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/behaviors/LeaderInstallSnapshotState.java index 5d47dbd02e..3b4c7d8133 100644 --- a/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/behaviors/LeaderInstallSnapshotState.java +++ b/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/behaviors/LeaderInstallSnapshotState.java @@ -94,7 +94,8 @@ public final class LeaderInstallSnapshotState implements AutoCloseable { boolean canSendNextChunk() { // we only send a false if a chunk is sent but we have not received a reply yet - return snapshotBytes != null && replyReceivedForOffset == offset; + return snapshotBytes != null && (nextChunkHashCode == INITIAL_LAST_CHUNK_HASH_CODE + || replyReceivedForOffset == offset); } boolean isLastChunk(int index) { @@ -127,7 +128,7 @@ public final class LeaderInstallSnapshotState implements AutoCloseable { int numRead = snapshotInputStream.read(nextChunk); if (numRead != size) { throw new IOException(String.format( - "The # of bytes read from the imput stream, %d, does not match the expected # %d", numRead, size)); + "The # of bytes read from the input stream, %d, does not match the expected # %d", numRead, size)); } nextChunkHashCode = Arrays.hashCode(nextChunk);