Primary shard for a DB is assigned to last shard node

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Cannot Reproduce
    • Priority: Major - P3
    • None
    • Affects Version/s: 3.1.0
    • Component/s: Sharding
    • ALL
    • Hide

      Scenario

      • 2 mongod shard nodes - s0 & s1
      • 1 mongod configsvr
      • 1 mongos
      • Connect to s0 via mongo shell
        • Insert in a collection on test2 DB
        • Insert in a collection on test3 DB
      • Connect to mongos via mongo shell
        • sh.addShard(<s0>)
        • sh.addShard(<s1>)
        • sh.enableSharding("test2")
        • sh.enableSharding("test3")
        • sh.enableSharding("test4")
        • sh.status()

      The primary shard node for the DBs are

      • test2 - s0
      • test3 - s1
      • test4 - s1
      Show
      Scenario 2 mongod shard nodes - s0 & s1 1 mongod configsvr 1 mongos Connect to s0 via mongo shell Insert in a collection on test2 DB Insert in a collection on test3 DB Connect to mongos via mongo shell sh.addShard(<s0>) sh.addShard(<s1>) sh.enableSharding("test2") sh.enableSharding("test3") sh.enableSharding("test4") sh.status() The primary shard node for the DBs are test2 - s0 test3 - s1 test4 - s1
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None

      If a database has been created on a shard node, before it's been sharded, the enabledSharding() will associate the primary shard to the last shard node in the cluster. This happens for all databases, except for the first one which is enabled.

            Assignee:
            Jonathan Abrahams (Inactive)
            Reporter:
            Jonathan Abrahams (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: