[SERVER-51518] Reconcile how PrimaryOnlyService::lookupInstance() expects opCtx holding locks to be tagged as always interruptible Created: 13/Oct/20  Updated: 29/Oct/23  Resolved: 14/Oct/20

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

Type: Task Priority: Major - P3
Reporter: Blake Oler Assignee: Max Hirschhorn
Resolution: Fixed Votes: 0
Labels: PM-234-M1, PM-234-T-lifecycle
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by SERVER-51209 Fill in missing gaps in Resharding wo... Closed
Related
related to SERVER-51650 Primary-Only Service's _rebuildCV sho... Closed
is related to SERVER-50982 PrimaryOnlyService::lookupInstance sh... Closed
is related to SERVER-51096 PrimaryOnlyService::getOrCreateInstan... Closed
Backwards Compatibility: Fully Compatible
Sprint: Sharding 2020-10-19
Participants:
Linked BF Score: 14

 Description   

// If this operation is holding any database locks, then it must have opted into getting
// interrupted at stepdown to prevent deadlocks.
invariant(!opCtx->lockState()->isLocked() || opCtx->shouldAlwaysInterruptAtStepDownOrUp());

OperationContext::setAlwaysInterruptAtStepDownOrUp() isn't called in the write command codepath and so the invariant in PrimaryOnlyService::lookupInstance() would get triggered. However, those operations are still interruptible at stepdown because they'll have acquire the global IX lock.



 Comments   
Comment by Githook User [ 14/Oct/20 ]

Author:

{'name': 'Max Hirschhorn', 'email': 'max.hirschhorn@mongodb.com', 'username': 'visemet'}

Message: SERVER-51518 Adjust lock invariant in PrimaryOnlyService::lookupInst().

The RstlKillOpThread will interrupt OperationContexts for which the
global lock was taken in mode IX, S, or X. Callers holding the global
lock in one of these modes are also safe.
Branch: master
https://github.com/mongodb/mongo/commit/0d265e042f25dcda8207b274ad6e991fc051b151

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