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

lock order is reversed when updating config.transactions

    • Type: Icon: Bug Bug
    • Resolution: Won't Fix
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 3.6.18
    • Component/s: None
    • Labels:
      None
    • Sharding
    • ALL

      Operations that work on the config database would take the config db lock first and then the local db lock to write to the oplog. However, when updating config.transactions for retryable writes or transactions, the local lock is taken first and then followed by config. At first glance it may look like the logOp is taking the local lock in this scope, but there are certain cases where unlock can be deferred until WUOW is finished. And the oplog write during retryable write or transactions falls into this case. In summary, what appeared to be a sequence of [lock local, unlock local, lock config, unlock config] is in fact, [lock local, (defer unlock local), lock config, unlock config, (unlock local for real)].

            Assignee:
            backlog-server-sharding [DO NOT USE] Backlog - Sharding Team
            Reporter:
            randolph@mongodb.com Randolph Tan
            Votes:
            0 Vote for this issue
            Watchers:
            15 Start watching this issue

              Created:
              Updated:
              Resolved: