Set to non-voting if not in server confguration 90/32390/2
authorTom Pantelis <tpanteli@brocade.com>
Tue, 12 Jan 2016 06:07:35 +0000 (01:07 -0500)
committerGerrit Code Review <gerrit@opendaylight.org>
Fri, 15 Jan 2016 13:15:29 +0000 (13:15 +0000)
commit8dabbaa07e7034a2f385f9b553eaf2dbde91525b
tree6086cc1bb9c3b266246e6ceb3c68d6a0083dfdaf
parent512d0285a34d6358881be4cf7102d1140217c07e
Set to non-voting if not in server confguration

On recovery, if a RaftActor is not in its own recovered
ServerConfigurationPayload list, then set itself to a non-voting member
so it stays at Follower and doesn't try to start an election.

This scenario is an edge case for Shards as, normally, when a server is
removed, it self-destructs and is removed from the ShardManager. However
there is a small window where disconnect or shutdown could prevent
ShardManager removal from occurring. This patch protects against a server
restart causing disruption after removal.

Change-Id: I64ecd89cddec7a4e1711e0d8d17c7ea6b36e29a0
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/RaftActorContextImpl.java
opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/RaftActorContextImplTest.java