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

dropIndex() should be idempotent.

    • Type: Icon: Bug Bug
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Storage Execution
    • ALL

      Currently, calling dropIndex again with the same param after running it the first time, will result in an IndexNotFound error.

      To repro:

      assert.commandWorked(mongos.getCollection(ns).createIndex({x: 1}, {name: indexName, collation: {locale: "simple"}}));
      
      assert.commandWorked(mongos.getCollection(ns).dropIndex(indexName));
      assert.commandWorked(mongos.getCollection(ns).dropIndex(indexName)); 

      The second call to dropIndex() will fail with IndexNotFound

            Assignee:
            Unassigned Unassigned
            Reporter:
            kshitij.gupta@mongodb.com Kshitij Gupta
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated: