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

Make database metadata refresh first check new metadata under the IS lock before taking X lock

    • Fully Compatible
    • v6.1, v6.0, v5.0
    • Sharding EMEA 2022-11-14

      `onDbVersionMismatch`, when not invoked with a `receivedDbVersion`, after getting the latest metadata from the configsvr will unconditionally attempt to acquire the DB lock in MODE_X, even if the received metadata is not newer than the cached one. Taking the DB lock in MODE_X is expensive, as it serialized with any ongoing writer or transaction on that db. This causes stalls on the user workload.

      Before SERVER-66972, there used to be an early check under the IS lock to exit early if the received version is not newer than the cached. This early check should be reintroduced to reduce the impact caused by secondaries calling _flushDatabaseCacheUpdates.

            Assignee:
            antonio.fuschetto@mongodb.com Antonio Fuschetto
            Reporter:
            jordi.serra-torrens@mongodb.com Jordi Serra Torrens
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: