From 458a2556a1adda963a6daf525e9bc0dceddb40ba Mon Sep 17 00:00:00 2001 From: Tomas Cere Date: Tue, 25 Jun 2019 14:16:50 +0200 Subject: [PATCH] Reset replyReceivedForOffset correctly 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 (cherry picked from commit 78282f605d76598e3b0e30cfc660a3a6c38ace48) --- .../cluster/raft/behaviors/LeaderInstallSnapshotState.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 7583452148..b362530d57 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 @@ -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(); -- 2.36.6