As shown in BF-25473, the aggregate command used to get a random document involves running getMore commands which can fail with a QueryPlanKilled error in the following cases:
- The node steps down or restarts between when the cursor is opened and when a getMore command arrives at the node.
- The node renames the collection due to resharding between when the cursor is opened and when a getMore command arrives at the node.
This is expected and the internal_transactions* workloads should retry the aggregate command in these cases. Alternatively, the aggregate command should be run with a large batchSize to avoid getMore commands.