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

Don't let to hide the last shard key index using a key pattern

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 6.0.4, 6.3.0-rc0
    • Affects Version/s: 6.0.3, 6.1.0-rc4, 6.2.0-rc1, 6.3.0-rc0
    • Component/s: None
    • None
    • Fully Compatible
    • ALL
    • v6.2, v6.0
    • Sharding EMEA 2022-12-12, Sharding EMEA 2022-12-26

      When we have only one shard key index, we cannot hide it.

      This behaviour is implemented checking the name of the index:

      assert.commandFailed(coll.hideIndex("skey_1")); // OK

      But we can still hide the index using the key pattern (not correct):

      assert.commandFailed(coll.hideIndex({skey: 1})); // KO

      And we will jump the checks and hide it.

      To be able to solve this issue we must get the indexName from the cmrIndex->idx and not from the local variable indexName in coll_mod.cpp.

            Assignee:
            pol.pinol@mongodb.com Pol Pinol
            Reporter:
            pol.pinol@mongodb.com Pol Pinol
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: