Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-40999

snapshot_read_kill_operations.js should accept CursorNotFound on currentOp

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • None
    • 4.1.11
    • None
    • None
    • Fully Compatible
    • ALL
    • Hide

      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.
      

      Show
      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.
    • 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

      Attachments

        Activity

          People

            james.wahlin@mongodb.com James Wahlin
            james.wahlin@mongodb.com James Wahlin
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: