Reset replyReceivedForOffset correctly 26/82726/1
authorTomas Cere <tomas.cere@pantheon.tech>
Tue, 25 Jun 2019 12:16:50 +0000 (14:16 +0200)
committerTomas Cere <tomas.cere@pantheon.tech>
Tue, 25 Jun 2019 12:34:32 +0000 (14:34 +0200)
replyReceivedForOffset needs to be set to the initial -1
otherwise we can have multiple sendSnapshotChunk()'s called
before receiving any replies. Which would fail due to the already
running stopwatch.

Change-Id: Ie708f0c2454a87f77cba97e4fed8a9ffc866b624
Signed-off-by: Tomas Cere <tomas.cere@pantheon.tech>
opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/behaviors/LeaderInstallSnapshotState.java

index 7583452..b362530 100644 (file)
@@ -174,10 +174,11 @@ public final class LeaderInstallSnapshotState implements AutoCloseable {
 
         offset = 0;
         replyStatus = false;
-        replyReceivedForOffset = offset;
+        replyReceivedForOffset = INITIAL_LAST_CHUNK_HASH_CODE;
         chunkIndex = FIRST_CHUNK_INDEX;
         currentChunk = null;
         lastChunkHashCode = INITIAL_LAST_CHUNK_HASH_CODE;
+        nextChunkHashCode = INITIAL_LAST_CHUNK_HASH_CODE;
 
         try {
             snapshotInputStream = snapshotBytes.openStream();

©2013 OpenDaylight, A Linux Foundation Collaborative Project. All Rights Reserved.
OpenDaylight is a registered trademark of The OpenDaylight Project, Inc.
Linux Foundation and OpenDaylight are registered trademarks of the Linux Foundation.
Linux is a registered trademark of Linus Torvalds.