SERVER-136917ClosedFixed

Skip writing QS entries that fail bson validation into the store

There are a class of QS entries that [QueryStatsStage::toDocument(...) skips outputting|https://github.com/10gen/mongo/blob/08ca0098282d41e26c46eeda7aa0d5e0fee647fe/src/mongo/db/exec/agg/query_stats_stage.cpp#L239-L275] because they violate certain BSON validation constraints. Since we know whether a QS entry will violate said constraints at write-time, we can explicitly avoid writing those entries to the store.  Perhaps this can also be extended to the other checks that lead to skipping entr

Affected Versions
Versions known to exhibit this issue

No affected versions recorded.

Fixed Versions
Versions that include the fix
9.1.0-rc09.1.0-rc1025
Components
Server components related to this issue

No components specified.

Labels
Tags and classification
dino-query-statsnewengquick-tech-debt