We must ensure that MetadataConsistencyCheck is executed only on a primary Replica Set node.
When this is not happening?
CASE 1
- metadataConsistencyCheck command is received on node1
- node1 steps down before we can set the opCtx as interruptible
- metadataConsistencyCheck thread marks the opCtx as interruptible
- metadataConsistencyCheck thread will never be interrupted because stepdown has already happened, so it will run on a secondary replica set node.
CASE 2
- metadataConsistencyCheck command is received on node1
- metadataConsistencyCheck thread marks the opCtx as interruptible
- node1 steps down before we can set the opCtx as interruptible
- metadataConsistencyCheck thread doesn't check if the opCtx has been interrupted and returns the result to the user