[SERVER-82363] Make ShardingTest wait for the config shard's config.shards entry to be updated on setup Created: 21/Oct/23  Updated: 12/Jan/24  Resolved: 07/Dec/23

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

Type: Bug Priority: Major - P3
Reporter: Wenqin Ye Assignee: Wenqin Ye
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Depends
Assigned Teams:
Sharding NYC
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v7.2
Sprint: Cluster Scalability 2023-11-13, Cluster Scalability 2023-11-27, Cluster Scalability 2023-12-11
Participants:
Linked BF Score: 35

 Description   

With auto-bootstrapping, it is not guaranteed that once `new ShardingTest` returns, the host field for the config shard's shard entry will contain all of the members of the replica set.

This is because with auto-bootstrapping, the host field will initially only contain the auto-bootstrapped node. The shard entry will only get updated to contain all of the nodes in the replica set when a mongos notices the config server replica set's other members (which can happen after `new ShardingTest` returns).

This is not a issue without auto-bootstrapping because the config shard is only created after the user has fully initiated their replica set. 



 Comments   
Comment by Liubov Molchanova [ 12/Jan/24 ]

Requesting a Backport for v7.2 as the issue continues to reproduce in BFG-2221210, BFG-2214083 and some others.

Comment by Githook User [ 07/Dec/23 ]

Author:

{'name': 'Wenqin Ye', 'email': 'wenqin908@gmail.com', 'username': 'wenqinYe'}

Message: SERVER-82363 Make ShardingTest wait for the config shard's config.shards entry to be updated on setup

GitOrigin-RevId: 457b601676c17188abea53cf8c5b2c055e086581
Branch: master
https://github.com/mongodb/mongo/commit/7643b99a66d205b00b372146beee24a74f7a1357

Comment by Randolph Tan [ 30/Oct/23 ]

I like the proactive update on config.shards & ShardRegistry better than the added wait.

Comment by Wenqin Ye [ 21/Oct/23 ]

I think a server change we can make is: on the config server, if there is a reconfig that adds new members, immediately update the shard entry for the config shard rather than waiting for the mongos to do it? 

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