[SERVER-51219] Make sure DBClient is interruptable on stepdown Created: 29/Sep/20  Updated: 27/Oct/23  Resolved: 08/Dec/20

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

Type: Task Priority: Major - P3
Reporter: Matthew Russotto Assignee: Pavithra Vetriselvan
Resolution: Gone away Votes: 0
Labels: pm-1791_milestone-E
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Sprint: Repl 2020-12-14
Participants:

 Description   

If the DBClient is being used as part of a PrimaryOnlyService, any long-running operations (including an exhaust cursor) must be interruptable.  We can assume it is being run on a thread belonging to an executor which will itself be interrupted (meaning any opCtxs created on that thread will be interrupted)



 Comments   
Comment by Matthew Russotto [ 08/Dec/20 ]

I believe this may have been filed when we only handled stepdown by setting a flag on the opCtx, rather than having an onStepDown. If onStepDown can call shutdownAndDisallowReconnect, we should be fine and there's nothing to do here.

Comment by Pavithra Vetriselvan [ 08/Dec/20 ]

While investigating the work for this, I found that we already have a shutdownAndDisallowReconnect function on DBClientConnection, which claims to interrupt operations waiting on the network. This will end up being called by PrimaryOnlyService::onStepDown, which will eventually be called through _performPostMemberStateUpdateAction during stepdown. So, I think things like the recipient connection to the donor should already get interrupted during stepdown.

matthew.russotto Is there additional scope to this ticket that I'm missing?
CC lingzhi.deng

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