Add raftVersion field to AppendEntriesReply 67/33767/6
authorTom Pantelis <tpanteli@brocade.com>
Tue, 26 Jan 2016 15:18:31 +0000 (10:18 -0500)
committerGerrit Code Review <gerrit@opendaylight.org>
Fri, 12 Feb 2016 01:14:38 +0000 (01:14 +0000)
commit224aa4f574c63576961dc9dc37e075e2e5096a5a
treee360915cd1dd45c5d3af393b6a6a4e1bb2628f15
parent4f99287c091545e966efa25094af56220f8779b0
Add raftVersion field to AppendEntriesReply

Added a raftVersion field to AppendEntriesReply and modified
AbstractLeader to store the raftVersion in the FollowerLogInformation.
This will enable sending the appropriate serialized version for
subsequent messages sent to the follower.

The raftVersion in the FollowerLogInformation is initialized to
0 (HELIUM_VERSION) so we assume the oldest version for backwards
compatibility until we get the first AppendEntriesReply with the
follower's actual version.

Since we're adding a new field to AppendEntriesReply this won't break
backwards compatibility as Java serialization handles that. The
raftVersion will be set to 0 if sent from a pre-boron version.

Change-Id: I4519c4f314674840f2578848b2888c3e8467dd21
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/FollowerLogInformation.java
opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/FollowerLogInformationImpl.java
opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/RaftVersions.java
opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/behaviors/AbstractLeader.java
opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/messages/AppendEntriesReply.java
opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/behaviors/LeaderTest.java