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

    XMLWordPrintableJSON

Details

    • Task
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • None
    • 6.1.1, 5.0.14, 6.0.4, 6.2.0-rc0
    • Sharding
    • None
    • Fully Compatible
    • v6.1, v6.0, v5.0
    • Sharding EMEA 2022-11-14

    Description

      `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.

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: