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

moveChunk find:{$minKey:1} matches incorrect chunk

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 2.0.3
    • Component/s: Sharding, Shell
    • Labels:
    • Sharding
    • ALL

      we have a sharded collection "x", with chunks:

      { "shard_id" : { $minKey : 1 } } -->> { "shard_id" : "0" } on : shard1 { "t" : 5000, "i" : 1 }
      { "shard_id" : "0" } -->> { "shard_id" : "d" } on : shard2 { "t" : 8000, "i" : 0 }
      { "shard_id" : "d" } -->> { "shard_id" : "k" } on : shard3 { "t" : 8000, "i" : 1 }
      { "shard_id" : "k" } -->> { "shard_id" : "z" } on : shard3 { "t" : 2000, "i" : 0 }
      { "shard_id" : "z" } -->> { "shard_id" : { $maxKey : 1 } } on : shard4 { "t" : 7000, "i" : 0 }
      

      from mongos:

      mongos> use admin;
      mongos> db.runCommand({"moveChunk":"mydb.x","find":{"email":{"$minKey":1}},"to":"shard4"});
      { "ok" : 0, "errmsg" : "that chunk is already on that shard" }
      mongos> db.runCommand({"moveChunk":"mydb.x","find":{"email":{"$lt":"0"}},"to":"shard4"});
      { "ok" : 0, "errmsg" : "that chunk is already on that shard" }
      

      is it incorrectly "finding" the last chunk?

            Assignee:
            backlog-server-sharding [DO NOT USE] Backlog - Sharding Team
            Reporter:
            wayne530 Y. Wayne Huang
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: