Code Review
/
controller.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Bug 8206: Fix IOException from initiateCaptureSnapshot
[controller.git]
/
opendaylight
/
md-sal
/
sal-akka-raft
/
src
/
main
/
java
/
org
/
opendaylight
/
controller
/
cluster
/
raft
/
behaviors
/
LeaderInstallSnapshotState.java
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 5d47dbd02ec9754e94e5bf0f3c81e1a769caf6ba..3b4c7d813309a3ddb0b03520ebf1254623578339 100644
(file)
--- 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
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) {
}
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(
int numRead = snapshotInputStream.read(nextChunk);
if (numRead != size) {
throw new IOException(String.format(
- "The # of bytes read from the i
m
put stream, %d, does not match the expected # %d", numRead, size));
+ "The # of bytes read from the i
n
put stream, %d, does not match the expected # %d", numRead, size));
}
nextChunkHashCode = Arrays.hashCode(nextChunk);
}
nextChunkHashCode = Arrays.hashCode(nextChunk);