TransactionCoordinator member variables hold mutexes too long

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Fixed
    • Priority: Major - P3
    • 8.2.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Replication
    • ALL
    • v8.1, v8.0
    • Repl 2025-07-07
    • 200
    • None
    • 3
    • TBD
    • None
    • None
    • None
    • None
    • None
    • None

      TransactionCoordinator instances (created & owned by the TransactionCoordinatorService) have member variables which take mutexes to mutate other variables. The CatalogAndScheduler wrapper type acquires these during join() which is also called in the destructor of the transaction coordinator's catalog instance. During that destructor path, there is a chain of mutexes that can recurse in some code paths, leading to deadlock.

      1. https://github.com/mongodb/mongo/blob/master/src/mongo/db/s/transaction_coordinator.cpp#L689
      2. https://github.com/mongodb/mongo/blob/master/src/mongo/db/s/transaction_coordinator.cpp#L460
      3. https://github.com/mongodb/mongo/blob/master/src/mongo/db/s/transaction_coordinator_service.cpp#L440
      4. https://github.com/mongodb/mongo/blob/master/src/mongo/db/s/transaction_coordinator_catalog.cpp#L272

            Assignee:
            Myles Hathcock
            Reporter:
            Myles Hathcock
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: