Cardinality and frequency metrics are obtained with an aggregation pipeline that runs with readConcern: available, which may go to the wrong shard. In tests where the balancer is on, the analyzeShardKey command can fail with error 7826507, "Cannot analyze the cardinality and frequency of a shard key because the number of sampled documents is zero" due to the chunk containing the sampled documents being moved by the balancer.
This error can be ignored.
- related to
-
SERVER-91030 analyzeShardKey against sharded collections may fail to find sampled docs if there has been data movement
- Closed