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

Partial indexes should not be allowed as shard key

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • 3.1.3
    • 3.1.1
    • Index Maintenance
    • Fully Compatible
    • ALL
    • Hide

          var st = new ShardingTest({ shards: 2 }); 
       
          var testDB = st.s.getDB('test');
          testDB.dropDatabase();
          var testCol = testDB.getCollection('partialTest');
       
          testCol.ensureIndex({a:1},{b:{$exists:1}});
          testDB.adminCommand({ enablesharding: 'test' }); 
          assert.commandFailed(testDB.adminCommand({ shardcollection: 'test.partialTest', key: { a : 1 }}));
      

      Show
      var st = new ShardingTest({ shards: 2 });   var testDB = st.s.getDB('test'); testDB.dropDatabase(); var testCol = testDB.getCollection('partialTest');   testCol.ensureIndex({a:1},{b:{$exists:1}}); testDB.adminCommand({ enablesharding: 'test' }); assert.commandFailed(testDB.adminCommand({ shardcollection: 'test.partialTest', key: { a : 1 }}));
    • Quint Iteration 3.1.2, Quint Iteration 3

    Description

      Partial indexes shouldn't be allowed to be used as the shard key.

      Attachments

        Activity

          People

            rassi J Rassi
            michael.grundy Michael Grundy
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: