Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-101579

Improve error message when a user is resharding to a zone that does not exist

    • Type: Icon: Task Task
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 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
      

            Assignee:
            Unassigned Unassigned
            Reporter:
            ratika.gandhi@mongodb.com Ratika Gandhi
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              None
              None
              None
              None