Remove the check about related_to

What we want is that when mongodb is do cluster-grow, by
_group_shard_instances[1] to determine which instance is a
replica set, this function in a replica sets can allow
an instance without related_to opintion, which same as our
originally planned is the same[2].
But now because of this check, result if have any instance
without related_to will be error, this check was placed in
the front of _group_shard_instances, resulting in we can
not achieve the originally planned. My idea is to
get rid of this check,with use _group_shard_instances to
see whether related_to meet the requirements for grow.

[1]:https://github.com/openstack/trove/blob/master/trove/common/strategies/cluster/experimental/mongodb/api.py#L496
[2]:https://specs.openstack.org/openstack/trove-specs/specs/liberty/cluster-scaling.html#add-replica-set

Change-Id: I9e2f441d1434617077368e05efe95032fab01d4f
This commit is contained in:
jiansong 2017-04-18 01:08:35 -07:00 committed by jian.song
parent 3371343613
commit c457e33964

View File

@ -477,7 +477,7 @@ class MongoDbCluster(models.Cluster):
query_routers = []
for item in instances:
if item['instance_type'] == 'replica':
replica_requirements = ['related_to', 'name']
replica_requirements = ['name']
if not all(key in item for key in replica_requirements):
raise exception.TroveError(
_('Replica instance does not have required field(s) '