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

Dropping an index named "*" is ambiguous because createIndexes permits an index to be named "*"

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: 3.5.5
    • Fix Version/s: 3.5.10
    • Component/s: Querying, Replication
    • Labels:
      None
    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL
    • Steps To Reproduce:
      Hide

      python buildscripts/resmoke.py --executor=jstestfuzz_replication repro_server29191.js
      

      repro_server29191.js

      var rst = new ReplSetTest({nodes: 2});
      rst.startSet();
      rst.initiate();
       
      var primaryDB = rst.getPrimary().getDB("test");
      var secondaryDB = rst.getSecondary().getDB("test");
       
      assert.commandWorked(primaryDB.mycoll.createIndex({x: 1}));
      assert.commandWorked(primaryDB.mycoll.createIndex({y: 1}, "*"));
      assert.commandWorked(primaryDB.mycoll.dropIndex({y: 1}));
       
      rst.awaitReplication();
       
      var indexes = primaryDB.mycoll.getIndexes();
      assert.eq(2, indexes.length, tojson(indexes));
       
      indexes = secondaryDB.mycoll.getIndexes();
      assert.eq(2, indexes.length, tojson(indexes));
       
      rst.stopSet();
      

      Show
      python buildscripts/resmoke.py --executor=jstestfuzz_replication repro_server29191.js repro_server29191.js var rst = new ReplSetTest({nodes: 2}); rst.startSet(); rst.initiate();   var primaryDB = rst.getPrimary().getDB( "test" ); var secondaryDB = rst.getSecondary().getDB( "test" );   assert.commandWorked(primaryDB.mycoll.createIndex({x: 1})); assert.commandWorked(primaryDB.mycoll.createIndex({y: 1}, "*" )); assert.commandWorked(primaryDB.mycoll.dropIndex({y: 1}));   rst.awaitReplication();   var indexes = primaryDB.mycoll.getIndexes(); assert.eq(2, indexes.length, tojson(indexes));   indexes = secondaryDB.mycoll.getIndexes(); assert.eq(2, indexes.length, tojson(indexes));   rst.stopSet();
    • Sprint:
      Repl 2017-07-10
    • Linked BF Score:
      0

      Description

      Prior to the changes from 6fd95f8 as part of SERVER-28200, the oplog entry for the "dropIndexes" command represented the index using its key pattern rather than its name. Dropping an index named "*" is interpreted by the replication subsystem as dropping all indexes and can cause the primary and secondaries not to have the same set of indexes.

      CC Judah Schvimer

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              matthew.russotto Matthew Russotto
              Reporter:
              max.hirschhorn Max Hirschhorn
              Participants:
              Votes:
              0 Vote for this issue
              Watchers:
              13 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: