-
Type: Improvement
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: Aggregation Framework, Sharding
-
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.
- depends on
-
SERVER-73557 Add ability for mongos to broadcast the shards part of a pipeline to all primaries and secondaries in a cluster
- Closed
- is depended on by
-
COMPASS-6739 Investigate changes in SERVER-45032: Allow $planCacheStats to target every shardsvr node in a sharded cluster
- Closed
- is related to
-
SERVER-45658 Allow $planCacheStats to target a specific node in a sharded cluster
- Backlog
-
SERVER-34633 Allow $currentOp to retrieve operations from all members of each shard in a cluster
- Closed
-
SERVER-44823 Sharding support for $planCacheStats
- Closed
- related to
-
SERVER-51117 report index information on a per-shard basis via getIndexes or similar command
- Closed