[SERVER-85452] config.shards can be outdated if auto bootstrap is not complete before replSetReconfig Created: 19/Jan/24  Updated: 07/Feb/24  Resolved: 07/Feb/24

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

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

Issue Links:
Backports
Depends
Problem/Incident
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v7.3
Sprint: Cluster Scalability 2024-1-22, Cluster Scalability 2024-2-5, Cluster Scalability 2024-2-19
Participants:
Linked BF Score: 156

 Description   

This bug surfaced from the fix made in SERVER-82363 due to changes from SERVER-21185.

As part of auto-bootstrap procedure, a shard entry is added in config.shards inside _transitionToConfigShard via scheduleTransitionToConfigShard. The _isReady promise of ShardingReady is fulfilled once the config entry is committed. In the case of calling it when stepping up a primary mongod as part of _shardingOnTransitionToPrimaryHook, a concurrent replSetReconfig command can cause ShardRegistry::scheduleReplicaSetUpdateOnConfigServerIfNeeded silently fail to update without retrying later due to no shard entry present yet. The previous function is called via ReplicationCoordinatorImpl post updating its replica set config document from _finishReplSetReconfig.



 Comments   
Comment by Githook User [ 07/Feb/24 ]

Author:

{'name': 'Wenqin', 'email': 'wenqinYe@users.noreply.github.com', 'username': 'wenqinYe'}

Message: SERVER-85452: Retry updating config.shards if sharding is not ready (#18523)

GitOrigin-RevId: 636391b003f1de818659521c21abec223f76eaf3
Branch: v7.3
https://github.com/mongodb/mongo/commit/1eee54b950720e914b36ac4f74a15c23162b5e80

Comment by Githook User [ 02/Feb/24 ]

Author:

{'name': 'Wenqin', 'email': 'wenqinYe@users.noreply.github.com', 'username': 'wenqinYe'}

Message: SERVER-85452: Retry updating config.shards if sharding is not ready (#18523)

GitOrigin-RevId: 71dd473c69e5ab5217550d210637262a73005e2b
Branch: master
https://github.com/mongodb/mongo/commit/5e82636904b505421c9994dddfa03d98d1366e06

Comment by Githook User [ 30/Jan/24 ]

Author:

{'name': 'auto-revert-processor', 'email': 'dev-prod-dag@mongodb.com', 'username': ''}

Message: Revert "SERVER-85452: Retry updating config.shards if sharding is not ready (#18302)"

This reverts commit b3b9914676d902785476266c3b7d6b618d853df2.

GitOrigin-RevId: b0faa9c800ee7947064cbad9f2db0f2242e1e903
Branch: master
https://github.com/mongodb/mongo/commit/576aea1526eaeeb7de128a93f9e4a07bdae53d9e

Comment by Githook User [ 29/Jan/24 ]

Author:

{'name': 'Wenqin', 'email': 'wenqinYe@users.noreply.github.com', 'username': 'wenqinYe'}

Message: SERVER-85452: Retry updating config.shards if sharding is not ready (#18302)

GitOrigin-RevId: b3b9914676d902785476266c3b7d6b618d853df2
Branch: master
https://github.com/mongodb/mongo/commit/68fc718562291aba49edb56e1de9fab6ad9881c9

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