Bug 2187: Implement add-replicas-for-all-shards RPC 22/31022/4
authorTom Pantelis <tpanteli@brocade.com>
Tue, 8 Dec 2015 13:38:47 +0000 (08:38 -0500)
committerGerrit Code Review <gerrit@opendaylight.org>
Mon, 14 Dec 2015 22:21:01 +0000 (22:21 +0000)
commit01be99539d7b19743a237b6e72d2d870491daf7a
treecbc7771360159521ea7422dc2d868844a841cdea
parentf9c49de804eb7741df63d0a15889d485d65660e7
Bug 2187: Implement add-replicas-for-all-shards RPC

Implemented the add-replicas-for-all-shards RPC. The yang RPC definition
was changed to return a list of results for each shard.

In the unit test I added a shard config dynamically to the new replica
member that doesn't exist in the leader to test a replica failure case.
This revealed an issue for FindPrimary where both member nodes forwarded the
RemoteFindPrimary message back and forth to each other as neither had
a local replica. To fix this, I added a visitedAddresses set to the
RemoteFindPrimary message to prevent the endless mutual recursion.

Change-Id: Icb0329db2c935f9825b81f593b83bdab13fa6b52
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/ShardManager.java
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/ShardPeerAddressResolver.java
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/admin/ClusterAdminRpcService.java
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/messages/RemoteFindPrimary.java
opendaylight/md-sal/sal-distributed-datastore/src/main/yang/cluster-admin.yang
opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/MemberNode.java
opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/admin/ClusterAdminRpcServiceTest.java