dropIndex() should be idempotent

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Unresolved
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Catalog and Routing
    • ALL
    • CAR Team 2025-07-21, CAR Team 2025-08-04
    • None
    • 3
    • 🟥 DDL, 🟦 Shard Catalog
    • None
    • None
    • None
    • None
    • None
    • None

      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:
            Manuel Álvarez Martínez
            Reporter:
            Kshitij Gupta (Inactive)
            Votes:
            1 Vote for this issue
            Watchers:
            13 Start watching this issue

              Created:
              Updated: