[SERVER-40999] snapshot_read_kill_operations.js should accept CursorNotFound on currentOp Created: 03/May/19  Updated: 29/Oct/23  Resolved: 03/May/19

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

Type: Bug Priority: Major - P3
Reporter: James Wahlin Assignee: James Wahlin
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Backwards Compatibility: Fully Compatible
Operating System: ALL
Steps To Reproduce:

This occurs is easy to reproduce on master with the following patch:

diff --git a/jstests/concurrency/fsm_workloads/snapshot_read_kill_operations.js b/jstests/concurrency/fsm_workloads/snapshot_read_kill_operations.js
index 6a68f7d93a..e4368296bf 100644
--- a/jstests/concurrency/fsm_workloads/snapshot_read_kill_operations.js
+++ b/jstests/concurrency/fsm_workloads/snapshot_read_kill_operations.js
@@ -148,8 +148,8 @@ var $config = (function() {
     }
 
     return {
-        threadCount: 5,
-        iterations: 10,
+        threadCount: 50,
+        iterations: 20,
         startState: 'init',
         states: states,
         transitions: transitions,
diff --git a/src/mongo/s/query/cluster_aggregate.cpp b/src/mongo/s/query/cluster_aggregate.cpp
index 2cbb292adc..350dccd2b7 100644
--- a/src/mongo/s/query/cluster_aggregate.cpp
+++ b/src/mongo/s/query/cluster_aggregate.cpp
@@ -827,6 +827,7 @@ Status ClusterAggregate::runAggregate(OperationContext* opCtx,
     // If not, split the pipeline as necessary and dispatch to the relevant shards.
     auto shardDispatchResults = sharded_agg_helpers::dispatchShardPipeline(
         expCtx, namespaces.executionNss, request, litePipe, std::move(pipeline), collationObj);
+    sleepmillis(100);
 
     // If the operation is an explain, then we verify that it succeeded on all targeted shards,
     // write the results to the output builder, and return immediately.

Participants:
Linked BF Score: 17

 Description   

The snapshot_read_kill_operations.js test executes the currentOp command concurrently with session kill. If run in a sharded fixture, it is possible for:
1) currentOp to be executed on mongos, which requests a batchSize:0 cursor from the shards
2) The cursor to be killed via session kill on mongod
3) mongos to request data for the cursor and receive cursorNotFound



 Comments   
Comment by Githook User [ 03/May/19 ]

Author:

{'email': 'james@mongodb.com', 'name': 'James Wahlin', 'username': 'jameswahlin'}

Message: SERVER-40999 snapshot_read_kill_operations.js should accept CursorNotFound on currentOp
Branch: master
https://github.com/mongodb/mongo/commit/2c7d89b667e30a64ea7165db99ed5e1206463f49

Generated at Thu Feb 08 04:56:32 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.