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

createIndexes command should check if index already exists with weak lock

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Critical - P2 Critical - P2
    • 3.6.9, 4.0.3, 4.1.4
    • Affects Version/s: None
    • Component/s: Storage
    • None
    • Fully Compatible
    • v4.0, v3.6
    • Storage NYC 2018-09-24
    • 8

      Currently createIndexes command takes the locks it needs to actual create an index.  If the index already exists (as is the case in a lot of scenarios where "just in case" createIndex is sent periodically or before running some process) concurrency could benefit significantly from checking if the index already exists under a weak lock.

      This would benefit cases where the index exists as is (success returned) or the index exists but with different options (failure returned) - neither of these would contribute to command requiring a strong lock.

            Assignee:
            louis.williams@mongodb.com Louis Williams
            Reporter:
            asya.kamsky@mongodb.com Asya Kamsky
            Votes:
            0 Vote for this issue
            Watchers:
            14 Start watching this issue

              Created:
              Updated:
              Resolved: