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

Allow $planCacheStats to target every shardsvr node in a sharded cluster

    • Query Execution
    • Fully Compatible

      In SERVER-44823, we improved $planCacheStats to be able to gather plan cache metadata from all of the shards in a sharded cluster. However, this operation uses the normal host targeting rules for selecting a single node in each shard. Unlike regular data, the plan cache metadata is not replicated and is local to each node. Rather than choose a single node from each shard, $planCacheStats should be capable of targeting every data-bearing node in the cluster—that is, every node in every shard, excluding the config servers.

      Achieving this behavior may require some work in the underlying sharding infrastructure, since I'm not aware of any other pre-existing sharded operation that targets every node in the cluster. Also, this could be a very expensive operation for large sharded clusters, so we should consider having users opt into this behavior explicitly, perhaps with a new readPreference setting or with an explicit flag on the $planCacheStats operation.

      Note that SERVER-34633 tracks a very similar improvement for the $currentOp agg stage.

            Assignee:
            ivan.fefer@mongodb.com Ivan Fefer
            Reporter:
            david.storch@mongodb.com David Storch
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved: