[SERVER-48298] Force refresh on removeShard and addShard Created: 19/May/20  Updated: 29/Oct/23  Resolved: 20/May/20

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: None
Fix Version/s: 4.4.0-rc7, 4.7.0

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

Issue Links:
Backports
Depends
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v4.4
Sprint: Sharding 2020-06-01
Participants:
Linked BF Score: 13

 Description   

Currently removeShard removes the entry in config.shards for the shard being removed and then calls ShardRegistry::reload(). It's possible that this reload actually joins an already running reload however, and so will still read in the entry just removed. We should check to see if the reload joined, and if so reload again.

Also, addShard currently inserts an entry into config.shards and then calls ShardRegistry::getShard() which checks for an entry for this shard and if it does not find one, reloads. It's possible that there is an old entry for the same shard in the ShardRegistry though, so we may decide not reload and leave the ShardRegistry in a stale state until the next refresh. To be sure the ShardRegistry picks up the newest targeter and RSM, we should force a refresh after inserting the doc.



 Comments   
Comment by Githook User [ 20/May/20 ]

Author:

{'name': 'jannaerin', 'email': 'golden.janna@gmail.com', 'username': 'jannaerin'}

Message: SERVER-48298 Force refresh on removeShard and addShard

(cherry picked from commit 820cc0f7b703ea0949c7a3c508d6708eed3d3afb)
Branch: v4.4
https://github.com/mongodb/mongo/commit/50d42159bc753a9c8d510e5b8aac39b28970ccf9

Comment by Githook User [ 19/May/20 ]

Author:

{'name': 'jannaerin', 'email': 'golden.janna@gmail.com', 'username': 'jannaerin'}

Message: SERVER-48298 Force refresh on removeShard and addShard
Branch: master
https://github.com/mongodb/mongo/commit/820cc0f7b703ea0949c7a3c508d6708eed3d3afb

Generated at Thu Feb 08 05:16:43 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.