[SERVER-51442] ShardRegistry should handle gracefully when ReplicaSetMonitor is deleted Created: 08/Oct/20  Updated: 06/Dec/22  Resolved: 22/Oct/20

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

Type: Task Priority: Major - P3
Reporter: Andrew Shuvalov (Inactive) Assignee: [DO NOT USE] Backlog - Sharding Team
Resolution: Won't Do Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by SERVER-51440 Cleanup refcounting and lifetime of R... Closed
Related
is related to SERVER-50189 Replace ReplicaSetMonitorManager::rem... Backlog
Assigned Teams:
Sharding
Participants:

 Description   

lamont.nelson says: 
The one thing I can think of that may be problematic would be that the RSM publishes to ShardRegistry, and I think one other listeners in the code so we just have to make sure it doesn't publish to a dead object gracefully handles publishing if an object is being shutdown. The shutdown path for the servers is a bit messy and there are implicit (and explicit) dependencies in the ordering of things. 
 
 
also right now remove will set that flag (I think it's  an atomic _isDropped in the new version).
 
 
basically in the servers the rsm starts pretty early and ends pretty late due to the ShardRegistry holding on to a targeter pointer.
 
See https://jira.mongodb.org/browse/SERVER-51440 for details.
 



 Comments   
Comment by Andrew Shuvalov (Inactive) [ 22/Oct/20 ]

Putting this on hold for now as it's unclear it's needed.

Comment by Andrew Shuvalov (Inactive) [ 11/Oct/20 ]

A test log that could be useful:

https://logkeeper.mongodb.org/lobster/build/5c6c8fb857fc319ad01e6e5189e4a4ff/test/5f81eb46c2ab683d1a993fd8#bookmarks=0%2C6601&l=1 

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