-
Type:
Task
-
Resolution: Unresolved
-
Priority:
Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
Cluster Scalability
-
None
-
None
-
None
-
None
-
None
-
None
-
None
Steps to reproduce:
Reshard a collection to a zone that does not exist yet
Atlas [mongos] test> db.adminCommand({ reshardCollection: "test.foo", key: { region_id: "hashed" },numInitialChunks: 1, forceRedistribution: true, zones: [ { zone: "NewZone1", min: { region_id: MinKey() }, max: { region_id: MaxKey() } }] }) MongoServerError[CannotCreateChunkDistribution]: The initial split policy is not able to find a chunk distribution that satisfies the given set of zones with the current shards
reshardCollection works after the zone is created.
sh.addShardToZone("atlas-gsohzn-shard-0", "NewZone1") db.adminCommand({ reshardCollection: "test.foo", key: { region_id: "hashed" },numInitialChunks: 1, forceRedistribution: true, zones: [ { zone: "NewZone1", min: { region_id: MinKey() }, max: { region_id: MaxKey() } }] }) Success
The error message should be the same as from updateZoneKeyRange command that the zone does not exist
Atlas [mongos] test> sh.updateZoneKeyRange("test.bar", {_id: MinKey()}, {_id: MaxKey()},"NewZone1") MongoServerError[ZoneNotFound]: zone NewZone1 does not exist