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

Make mongos pre-cache the routing table on startup

    XMLWordPrintable

    Details

    • Backport Requested:
      v4.2
    • Sprint:
      Sharding 2019-10-21, Sharding 2019-11-04
    • Case:

      Description

      Problem statement

      There are several types of performance problems due to the routing metadata. One is the predictable, high perf impact of mongos fetching the entire routing table from the config server at cold start-up.

      Proposal

      Make mongos preload the routing table for all collections on startup.

      1) Use ShardingCatalogClient::getAllDBs to get a vector of all the databases.

      2) For each database in the vector, use CatalogCache::getAllShardedCollectionsForDb  to get all its sharded collections.

      3) For each sharded collection, use CatalogCache::getShardedCollectionRoutingInfoWithRefresh to load the routing info for that collection.

      This logic can be placed  here in sharding initialization on mongos, which occurs synchronously during mongos startup.

      Test that the logic works by starting up a mongos and asserting on CatalogCache::Stats::countFullRefreshesStarted, which is returned by serverStatus.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              anton.oyung Anton Oyung
              Reporter:
              esha.maharishi Esha Maharishi
              Participants:
              Votes:
              0 Vote for this issue
              Watchers:
              8 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: