[SERVER-34061] Stop preemptively loading sharded collections when loading a database into the CatalogCache Created: 22/Mar/18 Updated: 29/Oct/23 Resolved: 30/Jun/20 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Sharding |
| Affects Version/s: | 3.7.3 |
| Fix Version/s: | 4.7.0 |
| Type: | Task | Priority: | Major - P3 |
| Reporter: | Esha Maharishi (Inactive) | Assignee: | Tommaso Tocci |
| Resolution: | Fixed | Votes: | 1 |
| Labels: | PM-1645-Milestone-2 | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||||||||||||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||||||||||||||||||||||||||
| Sprint: | Sharding 2020-06-29 | ||||||||||||||||||||||||||||||||
| Participants: | |||||||||||||||||||||||||||||||||
| Case: | (copied to CRM) | ||||||||||||||||||||||||||||||||
| Linked BF Score: | 10 | ||||||||||||||||||||||||||||||||
| Description |
|
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 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:
Once |
| Comments |
| Comment by Githook User [ 21/Jul/20 ] |
|
Author: {'name': 'Tommaso Tocci', 'email': 'tommaso.tocci@mongodb.com', 'username': 'toto-dev'}Message: |
| Comment by Githook User [ 30/Jun/20 ] |
|
Author: {'name': 'Tommaso Tocci', 'email': 'tommaso.tocci@mongodb.com', 'username': 'toto-dev'}Message: |
| Comment by Esha Maharishi (Inactive) [ 22/Mar/18 ] |
|
This is more important in 4.0, because database refresh can happen more frequently - after each movePrimary or dropDatabase. |