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

Databases are created on a shard node even if it's in draining state

    • Sharding
    • ALL
    • Hide
      • Create a 3 shard set, sh1, sh2, sh3
      • Start a mongos & config server
      • Connect to mongos
      • Create 4 DBs and insert data. Note that the DBs are created in a round-robin fashion across the shard nodes, i.e.,
        • sh1 - db1& db4
        • sh2 - db2
        • sh3 - db3
      • Remove sh2: db.adminCommand( { removeShard: "sh2" } )
        • The state will go to "draining", but will not complete because the primary database(s) must be moved (movePrimary) or dropped
      • Create another DB and insert data
      • Run the db.adminCommand( { removeShard: "sh2" } ) command
        • The new DB is now created on this shard node
        • Note same will happen if using mongorestore
      Show
      Create a 3 shard set, sh1, sh2, sh3 Start a mongos & config server Connect to mongos Create 4 DBs and insert data. Note that the DBs are created in a round-robin fashion across the shard nodes, i.e., sh1 - db1& db4 sh2 - db2 sh3 - db3 Remove sh2: db.adminCommand( { removeShard: "sh2" } ) The state will go to "draining", but will not complete because the primary database(s) must be moved (movePrimary) or dropped Create another DB and insert data Run the db.adminCommand( { removeShard: "sh2" } ) command The new DB is now created on this shard node Note same will happen if using mongorestore

      A node in a shard set can have a DB created on it, even if it's been set to a draining state (from removeShard).

            Assignee:
            backlog-server-sharding [DO NOT USE] Backlog - Sharding Team
            Reporter:
            jonathan.abrahams Jonathan Abrahams
            Votes:
            1 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: