-
Type: Task
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: 3.7.3
-
Component/s: Sharding
-
Fully Compatible
-
Sharding 2020-06-29
-
(copied to CRM)
-
10
Ideally, refreshing a cached database entry would only involve reading from "config.databases".
But for historical reasons, refreshing a database also reloads the list of the database's sharded collections (throwing out their cached routing info) and marks them as needsRefresh.
Unfortunately, we can't stop loading the sharded collections on database refresh, because pending SERVER-32198, shards treat a missing cache entry to mean "unsharded."
If we did, if a test uses a stale mongos against a shard whose in-memory cache has been reset, the stale mongos will refresh for the database but not for the collection -> mongos will send shardVersion UNSHARDED -> the shard will also believe the collection is unsharded -> the test fails because some documents were not found, count is wrong, etc.
Specifically, these suites would fail:
- read_only_sharded - because it restarts all shards + mongos, clearing their in-memory caches
- concurrency_sharded_causal_consistency - because it does reads through a stale mongos against secondaries that have never loaded their cache into memory
- concurrency_sharded_with_stepdowns - because it does reads through a stale mongos, and after a shard stepdown, the secondary that steps up has never loaded its cache into memory
Once SERVER-32198 is in, we should stop loading the sharded collections on database refresh.
- is depended on by
-
SERVER-48992 Implement database cache on top of ReadThroughCache
- Closed
- is duplicated by
-
SERVER-44249 Shard can continue to accept reads for a dropped collection if shard failover happens during setShardVersion sent at end of dropCollection
- Closed
- related to
-
SERVER-49196 Complete TODO listed in SERVER-34061
- Closed