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

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

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major - P3 Major - P3
    • 7.2.0-rc0, 7.0.3
    • None
    • None
    • None
    • Fully Compatible
    • ALL
    • v7.1, v7.0
    • Sharding NYC 2023-10-02
    • 2

    Description

      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. 

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: