Bug 2769: Fix issues with ApplyLogEntries 01/15901/4
authorTom Pantelis <tpanteli@brocade.com>
Sun, 1 Mar 2015 13:16:28 +0000 (08:16 -0500)
committerTom Pantelis <tpanteli@brocade.com>
Sun, 1 Mar 2015 14:36:34 +0000 (09:36 -0500)
commit05dbcdf234349f5563e13d102dcc02a39d8933a6
tree4113f047ce6b9d3fdb49971d8d24ca4a5d2e9e67
parent499c589d42fa52af58d85805aefe135f46d76787
Bug 2769: Fix issues with ApplyLogEntries

ApplyLogEntries defines toIndex as an int which is inconsistent with
everything else that stores journal indexes as long. In addition this
would cause an insiduous bug if an index was greater than max-int.

To maintain backwards compatibility, we can't change the type in
ApplyLogEntries so I created a new class, ApplyJournalEntries, that
defines toIndex as a long and deprecated ApplyLogEntries.

Also, the serialVersionUID for ApplyLogEntries was previously added in
Lithium however this would cause de-serialization failures when
recovering a pre-Lithium journal from persistence. So I removed the
serialVersionUID.

Change-Id: I7c5fe3a2ef8de292224a1a278abe53fc774a79d8
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/RaftActor.java
opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/base/messages/ApplyJournalEntries.java [new file with mode: 0644]
opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/base/messages/ApplyLogEntries.java
opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/behaviors/AbstractRaftActorBehavior.java
opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/RaftActorTest.java
opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/behaviors/LeaderTest.java
opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/utils/MockAkkaJournal.java
opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/ShardTest.java