`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.
- related to
-
SERVER-66972 Database critical section does not serialize with ongoing refreshes
- Closed