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

Primary shard for a DB is assigned to last shard node

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: Major - P3 Major - P3
    • None
    • 3.1.0
    • 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

    Description

      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.

      Attachments

        Activity

          People

            jonathan.abrahams Jonathan Abrahams
            jonathan.abrahams Jonathan Abrahams
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: