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

Simplify locking requirements for MigrationSourceManager::_cloneDriver

    • Type: Icon: Improvement Improvement
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Catalog and Routing
    • CAR Team 2025-03-03, CAR Team 2025-03-17
    • 1

      The comment for MigrationSourceManager::_cloneDriver requires holding a collection lock, the CSR lock and the _mutex to modify it, and just the _mutex to read it. In reality we don't rely on the _mutex at all, because we access it without holding the _mutex:

      • Here we are unsetting it.
      • Here we are reading it.
        In both cases there's no race condition thanks to the CSR lock.

      Furthermore we don't need the collection lock, since it's not providing any synchronization.

      We should simplify the locking around this field.

            Assignee:
            daniel.gomezferro@mongodb.com Daniel Gomez Ferro
            Reporter:
            daniel.gomezferro@mongodb.com Daniel Gomez Ferro
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: