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

ChunkManager::getShardIdsForRange should not hardcode isMaxInclusive to true

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Major - P3 Major - P3
    • None
    • None
    • Sharding
    • ALL

    Description

      getShardIdsForRange currently hardcodes isMaxInclusive to true and that causes mongos to target both of the shards in the following case.

      const st = ShardingTest({shards: 2});
       
      assert.commandWorked(st.s.adminCommand({enableSharding: "foo"}));
      st.ensurePrimaryShard("foo", st.shard0.shardName);
       
      assert.commandWorked(st.s.adminCommand({shardCollection: "foo.bar", key: {_id: 1}}));
      assert.commandWorked(st.s.adminCommand({split: "foo.bar", middle: {_id: 10}}));
      assert.commandWorked(st.s.adminCommand({moveChunk: "foo.bar", find: {_id: 10}, to: st.shard1.shardName, _waitForDelete: true}));
       
      assert.commandWorked(st.s.getDB("foo").runCommand({find: "bar", filter: {_id: {$lt: 10}}}));
      st.stop();
      

      Attachments

        Activity

          People

            daniel.gottlieb@mongodb.com Daniel Gottlieb (Inactive)
            cheahuychou.mao@mongodb.com Cheahuychou Mao
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: