[SERVER-85402] Make get_internal_connection_string() for ShardedClusterFixture in replica set endpoint mode not prone to returning the wrong connection string when there are changes to the call sites Created: 18/Jan/24  Updated: 06/Feb/24

Status: Open
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Task Priority: Major - P3
Reporter: Cheahuychou Mao Assignee: Backlog - Cluster Scalability
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Assigned Teams:
Cluster Scalability
Participants:

 Description   

Per the current design, replica set endpoint would only become active after the replica set has become a config shard (i.e. after the addShard or transitionFromConfigServer step) so before the ShardedClusterFixture has been set up, we must connect to a mongos or the router port of a mongod to run sharding commands, i.e. use the sharded connection string instead of the replica set connection string. For this reason, SERVER-84332 made get_internal_connection_string() check the new is_ready boolean (set to true at the end of await_ready() and set to false at the end of _do_teardown()) to determine which connection string should be returned.

Currently, there is no caching of connection string (i.e. get_internal_connection_string() is called per-test through this _make_process() call before running a test through this _execute() call) so the code introduced by SERVER-84332 works just fine. But if one day we switch to only getting the connection string once at the start of the suite, then the logic here would cause the suite to use the sharded connection string instead of the replica set connection string when we intend to test the replica set endpoint.


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