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

Error when a sleep is added to AsyncResultsMerger::_processBatchResults

    • Type: Icon: Bug Bug
    • Resolution: Gone away
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None
    • ALL
    • QE 2022-03-21

      With this diff:

      diff --git a/src/mongo/s/query/async_results_merger.cpp b/src/mongo/s/query/async_results_merger.cpp
      index 9100df3c57d..3025e627f0e 100644
      --- a/src/mongo/s/query/async_results_merger.cpp
      +++ b/src/mongo/s/query/async_results_merger.cpp
      @@ -761,6 +761,15 @@ void AsyncResultsMerger::_processBatchResults(WithLock lk,
           // Update the cursorId; it is sent as '0' when the cursor has been exhausted on the shard.
           remote.cursorId = cursorResponse.getCursorId();
      
      +    // Adding sleep to repro SERVER-31978
      +    if (remote.cursorId == 0 && _tailableMode == TailableModeEnum::kTailableAndAwaitData) {
      +        std::cout <<
      +              "AsyncResultsMerger()::_processBatchResults going to sleep" << std::endl;
      +        sleepmillis(5000);
      +        std::cout <<
      +              "AsyncResultsMerger()::_processBatchResults woke up" << std::endl;
      +    }
      +
           // Save the batch in the remote's buffer.
           if (!_addBatchToBuffer(lk, remoteIndex, cursorResponse)) {
               return;
      

      several tests fail with the error:
      uncaught exception: Error: [0] != [0] are equal : Cursor has been closed unexpectedly. Observed change stream events: [ null ] :

      This only happens in the change_streams_per_shard_cursors_passthrough suite.

      The failing tests are:
      whole_db_resumability
      apply_ops
      lookup_post_image
      whole_db_metadata_notifications
      metadata_notifications

      Filing this ticket to investigate the root cause.

            Assignee:
            jennifer.peshansky@mongodb.com Jennifer Peshansky (Inactive)
            Reporter:
            jennifer.peshansky@mongodb.com Jennifer Peshansky (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: