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

count may not yield before paging in initial candidate documents

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Duplicate
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Concurrency, Querying
    • Labels:

      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

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

                Dates

                Created:
                Updated:
                Resolved: