[SERVER-80489] refine_shardkey_config_cache_refresh.js can fail due to concurrent CatalogCache refresh Created: 29/Aug/23  Updated: 29/Oct/23  Resolved: 13/Sep/23

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 7.2.0-rc0

Type: Bug Priority: Major - P3
Reporter: Jordi Serra Torrens Assignee: Jordi Serra Torrens
Resolution: Fixed Votes: 0
Labels: car-71-backport-declined, shardingemea-qw
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Assigned Teams:
Sharding EMEA
Backwards Compatibility: Fully Compatible
Sprint: Sharding EMEA 2023-09-18
Participants:
Linked BF Score: 20
Story Points: 1

 Description   

refine_shardkey_config_cache_refresh.js manually modifies the ShardServerCatalogCacheLoader internal collections. In particular, here it removes all persisted cached chunks. This leaves the ShardServerCatalogCacheLoader in an invalid state, during which if a refresh is requested it can trip tasserts such as this one.
With the commit of SERVER-76486, which introduces an asynchronous fire-and-forget refresh at the end or refineCollectionShardkey, now it can happen that a refresh is requested while the test has left the ShardServerCatalogCacheLoader in an invalid state.

We should either modify the test to somehow ensure the refresh does not happen during the invalid period, or remove this test and replace it with a unit test on shard_server_catalog_cache_loader_test.cpp if it doesn't already exist. The latter seems like a better approach.



 Comments   
Comment by Githook User [ 13/Sep/23 ]

Author:

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

Message: SERVER-80489 Rewrite refine_shardkey_config_cache_refresh.js as unit test
Branch: master
https://github.com/mongodb/mongo/commit/d3065025d46f42e9dcbc83c4eaac0735beded6fe

Generated at Thu Feb 08 06:43:42 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.