When the shard is executing a checkMetadataConsistency (_shardsvrCheckMetadataConsistency) with a cluster level, it needs to know all databases which is the db primary shard. This is retrieved by a call on the config server to look for all entries in `config.databases` where the caller is the db primary shard.
Then, we iterate each database found and try to acquire the DDL lock. Currently, if we receive a StaleDbVersion, the checkMetadataConsistency for that database is skipped.
Receiving a StaleDbVersion at that point is because of one of the three scenarios:
- MovePrimary operation that has changed db primary shard.
- Database has been dropped
- Database exists but the db primary shard doesn’t know about the existence of this (cached information is marked as unknown)
The goal of this ticket is to make checkMetadataConsistency not ignore scenario n.3. by triggering a refresh of that database if there is no cached information.
- causes
-
SERVER-90688 Coverity analysis defect 155599: Dereference null return value
- Closed
- is related to
-
SERVER-89074 Add testing for checkMetadataConsistency when it makes the node refresh db metadata if it doesn't exist
- Closed