[SERVER-54874] Ensure reading of consistent config.collections and config.chunks when refreshing the CatalogCache Created: 02/Mar/21  Updated: 29/Oct/23  Resolved: 15/Mar/21

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: None
Fix Version/s: 4.9.0

Type: Task Priority: Major - P3
Reporter: Jordi Serra Torrens Assignee: Jordi Serra Torrens
Resolution: Fixed Votes: 0
Labels: PM-234-Catalog-Work, sharding-csrs-stepdown-also
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by SERVER-53539 TypeCollectionReshardingFields are in... Closed
Problem/Incident
causes SERVER-56190 Fix wrong nss in ExpressionContext fo... Closed
causes SERVER-59803 Set maxTimeMs for catalog cache refre... Closed
Related
related to SERVER-56302 Catalog cache refresh can fail with S... Closed
Backwards Compatibility: Fully Compatible
Sprint: Sharding 2021-03-22
Participants:
Linked BF Score: 126

 Description   

Currently, when the ConfigServerCatalogCache refreshes, it first issues a majority read on config.collections and after that it issues a second majority read on config.chunks Because of this, the collection metadata we read from config.collections may not be consistent with the chunks (and thus collection version) we read from config.chunks.

To address this we need to ensure that we read config.collections and config.chunks 'as a package'. To do so, we can use an aggregation pipeline on config.collections that has a $lookUp stage from config.chunks, and attach a snapshot read concern.



 Comments   
Comment by Githook User [ 15/Mar/21 ]

Author:

{'name': 'Jordi Serra Torrens', 'email': 'jordi.serra-torrens@mongodb.com', 'username': 'jordist'}

Message: SERVER-54874: Ensure reading consistent config.collections and config.chunks when refreshing the CatalogCache

(cherry picked from commit 538cb2ff982aab2a60c4f3ab53eb1ba6d1acfeb9)
Branch: master
https://github.com/mongodb/mongo/commit/d22d0058c4f02c7bcd7337af8b1058cac8e26e45

Comment by Githook User [ 09/Mar/21 ]

Author:

{'name': 'Jordi Serra Torrens', 'email': 'jordi.serra-torrens@mongodb.com', 'username': 'jordist'}

Message: Revert "SERVER-54874: Ensure reading consistent config.collections and config.chunks when refreshing the CatalogCache"

This reverts commit dc009c5a8d484f6a0db2f357274e14e30ea9f476.
Branch: master
https://github.com/mongodb/mongo/commit/e85a000b214e73783b406dadfb229cde21f3e8c5

Comment by Githook User [ 08/Mar/21 ]

Author:

{'name': 'Jordi Serra Torrens', 'email': 'jordi.serra-torrens@mongodb.com', 'username': 'jordist'}

Message: SERVER-54874: Ensure reading consistent config.collections and config.chunks when refreshing the CatalogCache
Branch: master
https://github.com/mongodb/mongo/commit/dc009c5a8d484f6a0db2f357274e14e30ea9f476

Generated at Thu Feb 08 05:34:44 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.