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

Acquire locks by collection UUID during the createIndexes command

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 4.3.1
    • Affects Version/s: None
    • Component/s: Storage
    • Labels:
      None
    • Fully Compatible
    • Execution Team 2019-07-15, Execution Team 2019-07-29
    • 15

      In the past, when a collection lock is dropped during an index build, there was no chance that the name of the collection would change. Because of this, createIndexes could be sure that for the entire lifetime of the function the name of the collection wouldn't change. 

      However, SERVER 37720 will allow renameCollection during index builds. This will no longer allow us to be sure that the name of the collection stays the same for the duration of the function.

      To fix this, first get a collection X lock on the collection based on the namespace provided by the createIndexes request, fetch the collection UUID under a lock, then use AutoGetCollection to acquire the collection lock by UUID for the remainder of the createIndexes operation.

      For the remainder of the function, locks of the collection should be done using AutoGetCollection to lock the collection given the UUID.

            Assignee:
            dan.solnik@mongodb.com Daniel Solnik (Inactive)
            Reporter:
            dan.solnik@mongodb.com Daniel Solnik (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: