In 3.4 and earlier, when the Range Deleter is waiting for the open cursors, it lists these cursors in the logs as below. In this case, we can just run the killCursors command to kill them, to unblock the range deleter (and chunk migration to this shard) when needed.
[RangeDeleter] waiting for open cursors before removing range [{ KEY: VALUE1}, { KEY: VALUE2}) in DATABASE.COLLECTION, elapsed secs: N, cursor ids: [XXX, ...]
However, in 3.6 and above, the message is different and doesn't include the cursor id(s):
Deletion of DATABASE.COLLECTION range [{ KEY: VALUE1 }, { KEY: VALUE2 }) will be scheduled after all possibly dependent queries finish
The listCursors command is only added since 4.2, so for 3.6 and 4.0, it's a bit difficult to locate these cursors. We may have to restart the application or step down the primary, in order to kill these cursors/unblock the chunk migration to this shard. This is more destructive than just killing the cursors if we know the cursor ids.
As such, if the Range Deleter is waiting for the open cursors, it would be nice to also list these cursor ids in MongoDB 3.6+.
- is related to
-
SERVER-50182 Open cursors can block cleanupOrphaned
- Closed