The function runTransactionOnShardingCatalog() is called when a config server operation needs to execute an internal transaction.
This function creates a new OperationContext under an AlternativeClientServer that is set as interruptible a few lines below its creation.
If the OperationContext got killed by the stepdown thread right before setting it as interruptible, we would end up in a deadlock. This is the event sequence for a deadlock:
Under runTransactionOnShardingCatalog(), create a new OperationContext.
Step-down thread kicks in and kills the recently created OperationContext, but it's not killed because it doesn't meet the conditions to be killed.
The new OperationContext is set as interruptible (but late).
The internal transaction checks out a session.
Step-down thread acquires the RSTL lock.
Step-down thread checks out all the active sessions to kill them. Gets stuck here since one session is still checked out by the non-interrupted thread.
The internal transaction tries to get the RSTL lock here and gets stuck.
- is caused by
-
SERVER-76749 runTransactionOnShardingCatalog should not assign the current operation context session id to the new operation context
- Closed