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

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

    XMLWordPrintable

    Details

      Description

      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.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              backlog-query-execution Backlog - Query Execution
              Reporter:
              david.storch David Storch
              Participants:
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated: