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

Make analyzeShardKey and query sampling take locks when looking up collection UUID

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 7.2.0-rc0, 7.0.3
    • Affects Version/s: None
    • Component/s: None
    • None
    • Fully Compatible
    • ALL
    • v7.1, v7.0
    • Sharding NYC 2023-10-02
    • 2

      The code for analyzeShardKey and query sampling currently looks up the uuid for a collection by doing lookupUUIDByNSS() (e.g. here and here) which based on the documentation doesn't require holding locks. However, as described in SERVER-81182 and BF-29025, looking up the uuid this way isn't safe against rollback and shutdown. The code should be changed to use the shard_role helper acquireCollectionMaybeLockFree like suggested by the storage execution team. 

            Assignee:
            cheahuychou.mao@mongodb.com Cheahuychou Mao
            Reporter:
            cheahuychou.mao@mongodb.com Cheahuychou Mao
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: