dropIndex() should be idempotent

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Fixed
    • Priority: Major - P3
    • 8.3.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Catalog and Routing
    • Fully Compatible
    • ALL
    • CAR Team 2025-07-21, CAR Team 2025-08-04, CAR Team 2025-08-18
    • 0
    • 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:
              14 Start watching this issue

                Created:
                Updated:
                Resolved: