[SERVER-52791] Make PrimaryOnlyService::shutdown explicitly interrupt tracked OperationContexts Created: 11/Nov/20  Updated: 29/Oct/23  Resolved: 22/Feb/21

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

Type: Bug Priority: Major - P3
Reporter: Esha Maharishi (Inactive) Assignee: Blake Oler
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by SERVER-54035 Create a cleanupResharding command Closed
Related
related to SERVER-54839 Fix data races in PrimaryOnlyService Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Service arch 2020-12-28, Sharding 2021-02-22
Participants:
Story Points: 1

 Description   

SERVER-51095 made PrimaryOnlyService::stepdown explicitly interrupt tracked OperationContexts, because a PrimaryOnlyService instance could create a new OperationContext in the window between when the stepdown thread kills OperationContexts and calls PrimaryOnlyService::stepdown via updateMemberState.

On shutdown:

First ReplicationCoordinator::stepdown is called.

Then ReplicationCoordinator::shutdown is called, which calls PrimaryOnlyService::shutdown, which joins all running instances.

Finally, all OperationContexts are marked as killed.

However, the first step ReplicationCoordinator::stepdown is allowed to fail. In that case, PrimaryOnlyService::shutdown may try to join a running instance whose OperationContext has not been interrupted.

To avoid this, PrimaryOnlyService::shutdown should also explicitly interrupt all its OperationContexts.



 Comments   
Comment by Githook User [ 18/Feb/21 ]

Author:

{'name': 'Blake Oler', 'email': 'blake.oler@mongodb.com', 'username': 'BlakeIsBlake'}

Message: SERVER-52791 Make PrimaryOnlyService::shutdown explicitly interrupt tracked OperationContexts
Branch: master
https://github.com/mongodb/mongo/commit/c3bae033840342b65384deb9dba7763f567f3a6c

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