-
- Problem
The checkMetadataConsistency command runs an internal aggregation containing a $group that does not set allowDiskUse. When internalDocumentSourceGroupMaxMemoryBytes is lowered process-wide (via setParameter), that $group exceeds its in-memory limit and fails with QueryExceededMemoryLimitNoDiskUseAllowed (code 292):
Failed to execute aggregation for: Check collection metadata consistency across shards :: caused by :: Exceeded memory limit for $group, but didn't allow external spilling; pass allowDiskUse:true to opt in
This surfaces via the CheckMetadataConsistencyInBackground hook when a query knob PBT sets the knob to a small value on all non-config nodes. Two tests lower this knob process-wide:
- jstests/core/query/query_settings/query_settings_knob_validation_pbt.js
- jstests/core/query/query_knob_correctness_pbt.js
It is the same class of failure already worked around for unionWith.js and release_memory/group.js.
-
- Fix
Add both PBTs to the CheckMetadataConsistencyInBackground.SKIP_TESTS list so the background check is disabled while they run, and re-include internalDocumentSourceGroupMaxMemoryBytes in the validation-parity PBT's knob coverage.
Fixes BF-44650 (and the related CheckMetadataConsistencyInBackground failures seen in BF-44347).