[SERVER-66658] Shard registry might be accessed before initialization Created: 23/May/22  Updated: 29/Oct/23  Resolved: 25/May/22

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: 5.0.7, 6.0.0-rc6
Fix Version/s: 6.0.1, 5.0.10, 6.1.0-rc0

Type: Bug Priority: Major - P3
Reporter: Marcos José Grillo Ramirez Assignee: Tommaso Tocci
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: Text File BF-23456_repro.patch    
Issue Links:
Backports
Depends
Problem/Incident
causes SERVER-67169 Wrong comparison might make shard reg... Closed
is caused by SERVER-57280 ShardRegistry must be initialized bef... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v6.0, v5.3, v5.0
Sprint: Sharding EMEA 2022-05-30
Participants:
Linked BF Score: 6

 Description   

SERVER-57280 introduced a mechanism that tried to prevent accesses to the shard registry via the getShardNoReload before setting up the shard registry. However, there is a race that can happen after setting the isUp variable from a thread that is performing the first refresh, and another thread using the non causally consistent API, that might result on the shard registry not finding any shard if the node have been recently started.



 Comments   
Comment by Githook User [ 22/Jul/22 ]

Author:

{'name': 'Tommaso Tocci', 'email': 'tommaso.tocci@mongodb.com', 'username': 'toto-dev'}

Message: SERVER-66658 Shard registry might be accessed before initialization

(cherry picked from commit 4851768e1d7c54e576300c75a976910e96703458)
Branch: v6.0
https://github.com/mongodb/mongo/commit/a1189eadd80ceedf5f6926e3127d65a03cff5af3

Comment by Githook User [ 11/Jul/22 ]

Author:

{'name': 'Tommaso Tocci', 'email': 'tommaso.tocci@mongodb.com', 'username': 'toto-dev'}

Message: SERVER-66658 Shard registry might be accessed before initialization

(cherry picked from commit 4851768e1d7c54e576300c75a976910e96703458)
Branch: v5.0
https://github.com/mongodb/mongo/commit/b9a8d8bc44181a0fe9b39525abb98620b9440c90

Comment by Githook User [ 25/May/22 ]

Author:

{'name': 'Tommaso Tocci', 'email': 'tommaso.tocci@mongodb.com', 'username': 'toto-dev'}

Message: SERVER-66658 Shard registry might be accessed before initialization
Branch: master
https://github.com/mongodb/mongo/commit/4851768e1d7c54e576300c75a976910e96703458

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