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

count may not yield before paging in initial candidate documents

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major - P3
    • Resolution: Duplicate
    • None
    • None
    • Concurrency, Querying

    Description

      Current behavior of count is to construct a ClientCursor and perform non in mem yielding only after an elapsed tracker has elapsed. But this means it may hold a read lock while initial candidate documents are paged in.

                      if ( !ccPointer ) {
                          if ( timeToStartYielding.intervalHasElapsed() ) {
                              // Lazily construct a ClientCursor, avoiding a performance regression when scanning a very
                              // small number of documents.
                              ccPointer.reset( new ClientCursor( QueryOption_NoCursorTimeout, cursor, ns ) );
                          }
                      }
                      else if ( !ccPointer->yieldSometimes( simpleEqualityMatch ? ClientCursor::DontNeed : ClientCursor::MaybeCovered ) ||
                               !cursor->ok() ) {
                          break;
                      }

      In 2.0 count did not have non in mem yielding, so current behavior does improve on that.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              aaron Aaron Staple
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: