BUG 3054 : Check readiness status of datastore when receiving MemberUp. 50/19250/3
authorMoiz Raja <moraja@cisco.com>
Tue, 28 Apr 2015 18:15:51 +0000 (11:15 -0700)
committerTom Pantelis <tpanteli@brocade.com>
Sun, 26 Apr 2015 00:55:11 +0000 (20:55 -0400)
commit4ded8407b8cc21fe329f49b378a088a703c707fc
treea28733655ec21b9eb608cc4c621de18ea6ddd2e5
parentaa0f5891c18ee67da16f06b36f8f5a63b8f7c1ac
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>
(cherry picked from commit bc5e040c7362243607e04045ac9d9309817bb9c1)
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