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

Small optimizations for mongos find

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 8.0.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • Cluster Scalability
    • Fully Compatible
    • Cluster Scalability 2024-3-18, Cluster Scalability 2024-4-1

      A few small optimizations for how mongos find uses the network:

      1. The ARS will lookup the shard registry object for each request when scheduling it but typically (at least for find), the command that uses the ARS already looked it up to target the request. We could allow providing the shard along with the request instead.
      2. establishCursors and the ARS takes its requests as const references to a vector. We should be able to use value types and std::move to save some BSON copies, e.g. here when appending operationKey to each request.
        1. We can also consider appending the operationKey directly in cluster find before calling establishCursors.
      3. Getting a host from the RSM for the shardId will call getHostOrRefresh, which requires an executor future, but typically the hosts will already be cached, so we can add a fast path that returns the cached hosts without the future / executor overhead.

            Assignee:
            jack.mulrow@mongodb.com Jack Mulrow
            Reporter:
            jack.mulrow@mongodb.com Jack Mulrow
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: