BUG 3054 : Check readiness status of datastore when receiving MemberUp. 53/19253/2
authorMoiz Raja <moraja@cisco.com>
Tue, 28 Apr 2015 18:15:51 +0000 (11:15 -0700)
committerMoiz Raja <moraja@cisco.com>
Tue, 28 Apr 2015 18:33:55 +0000 (11:33 -0700)
commitbc5e040c7362243607e04045ac9d9309817bb9c1
tree00774161486129c57ba8196ff8acca3f279eb7a5
parent7159b15b0efedb548f7fae5bb1eb9e970bc2e43f
BUG 3054 : Check readiness status of datastore when receiving MemberUp.

A Follower knows who the Leader is when it receives an AppendEntries message,
however it does record the address of the leader, that is supplied by the
ShardManager when the ShardManager receives a MemberUp. The Follower cannot
be considered ready till it knows both who the leader is and what is it's
address. This patch ensures that the ShardManager counts down the readiness
latch only when the follower knows both.

This also ensures that FindPrimaryShard will only return a primary if the Leader
is truly known.

Change-Id: I1cd6b62124d50c9eca37368d0379b0c75168bb76
Signed-off-by: Moiz Raja <moraja@cisco.com>
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/ShardManager.java
opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/ShardManagerTest.java
opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/utils/MockClusterWrapper.java