Due to the introduction of tracked unsharded collections (PM-3364) the numShardedCollections metric reported in server status is now wrong because it reports both sharded and tracked unsharded collections.
In order to report only sharded collection, we would need to perform a read on config.collections filtering out tracked unsharded collection. Unfortunately, this operation is to slow to be executed as part of serverStatus command execution. On the other hand maintaining a cached count of the sharded collection would require a significant effort.
Since the number of sharded collection can be easily retrieved by means of user facing server API we decided to remove this metric from the serverStatus command.
Additionally, this metric was introduced in SERVER-68576 because at that time we didn't have a easy way of retrieving collection statistics in Atlas clusters. CLOUDP-237418 will provide a solution to this that rely on collStats rather than the output of server status.
- is depended on by
-
COMPASS-7828 Investigate changes in SERVER-89065: Remove numShardedCollections metrics from serverStatus
- Needs Triage
-
TOOLS-3514 Investigate changes in SERVER-89065: Remove numShardedCollections metrics from serverStatus
- Closed
- is related to
-
SERVER-68576 We need to know how many sharded collections exist in a cluster
- Closed
- related to
-
SERVER-82760 Report number of sharded/unsharded collections in server status
- Closed