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

count may not yield before paging in initial candidate documents

    • Type: Icon: Improvement Improvement
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Concurrency, Querying

      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.

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

              Created:
              Updated:
              Resolved: