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

After MovePrimary on unsharded database mongodb cluster works incorrectly

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Critical - P2 Critical - P2
    • None
    • Affects Version/s: 2.4.8
    • Component/s: Sharding
    • None
    • ALL

      I complete the following steps:

      1. Start sharded cluster with 3 config, sh000 and sh001 shards, 3 routers.
      2. Start application (creates 4 databases and put some initial small data)
      3. Stop application
      4. Move one database to another shard (sh001 -> sh000) using MovePrimary (name: cloud_perf_default)

      In version 2.4.5 I see that db has been moved only on mongos, where command has been issued. Other routers says that database hasn't been moved. Restarting Mongos helps.
      Now in 2.4.8 this look ok and all routers says that db has been moved.

      After some time i decided to drop all app databases. And see that my database (cloud_perf_default) can't be deleted, but mongos returns ok: 1.

      Now, here is my outputs:

      mongos> sh.status()
      --- Sharding Status --- 
        sharding version: {
              "_id" : 1,
              "version" : 3,
              "minCompatibleVersion" : 3,
              "currentVersion" : 4,
              "clusterId" : ObjectId("52bd869c18410ba74327fcb3")
      }
        shards:
              {  "_id" : "sh000",  "host" : "sh000/E235A:27018" }
              {  "_id" : "sh001",  "host" : "sh001/E242E:27018" }
        databases:
              {  "_id" : "admin",  "partitioned" : false,  "primary" : "config" }
              {  "_id" : "cluster_test_r14_sys_jms_store",  "partitioned" : false,  "primary" : "sh000" }
              {  "_id" : "test",  "partitioned" : false,  "primary" : "sh000" }
              {  "_id" : "db",  "partitioned" : false,  "primary" : "sh000" }
      
      mongos> show dbs;
      admin   (empty)
      cloud_perf_default      5.951171875GB
      config  0.046875GB
      test    (empty)
      

      database cluster_test_r14_sys_jms has been delete at the begin of this story (why it still there?)
      Shard 000: pay attention that there is no cluster_test_r14_sys_jms

      sh000:PRIMARY> show dbs;
      local   10.0732421875GB
      test    (empty)
      

      Shard 001: actually database exists but on wrong shard. And with data?
      How can it be? Write on old shard, trying to read from new?

      sh001:PRIMARY> show dbs;
      cloud_perf_default      5.951171875GB
      local   10.0732421875GB
      

      I can't find similar issues so decided to create new one. Probably this already has been fixed in new version.

            Assignee:
            david.hows David Hows
            Reporter:
            jsirex Yauhen Artsiukhou
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: