[SERVER-23544] Race condition can allow using a SyncClusterConnection to talk to config servers even after swapping CatalogManager to CSRS mode Created: 05/Apr/16  Updated: 25/Jan/17  Resolved: 14/Apr/16

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: 3.3.4
Fix Version/s: 3.2.6

Type: Bug Priority: Major - P3
Reporter: Spencer Brody (Inactive) Assignee: Spencer Brody (Inactive)
Resolution: Done Votes: 0
Labels: code-only, csrsupgrade
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Sharding 13 (04/22/16)
Participants:
Linked BF Score: 0

 Description   

There's a race when creating a SyncClusterConnection around the same time as another thread performs a catalog swap. Imagine you need to talk to the config server for some reason. You check whether you're in SCCC or CSRS mode and see that you are in SCCC mode, so you get ready to create a SyncClusterConnection to talk to the config servers. Before you do, however, another thread communicates with the config servers and notices the need to swap catalog managers. The catalog managers swap, then the original thread proceeds with creating the SyncClusterConnection. Normally if the config servers had switched to CSRS mode, connecting the SyncClusterConnection would fail because it would run isMaster against the first config server and see that it's mode is different than the one we're using. But in this case we'll see that the config server is in CSRS mode, and we'd check what mode we're in and see that we're also in CSRS mode, so there's nothing to do! The SyncClusterConnection connects successfully and is used to run the query.



 Comments   
Comment by Githook User [ 14/Apr/16 ]

Author:

{u'username': u'stbrody', u'name': u'Spencer T Brody', u'email': u'spencer@mongodb.com'}

Message: SERVER-23544 Always fail to create SyncClusterConnections after CatalogManager swap to CSRS mode
Branch: v3.2
https://github.com/mongodb/mongo/commit/697f8f1bc8572ee3c74869223f5753a0bd0e46c9

Comment by Spencer Brody (Inactive) [ 05/Apr/16 ]

Proposed fix is to change the connection hook to always fail to connect if the connection being made is part of a SyncClusterConnection and the config server reports it's in csrs mode.

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