Background
Query knobs are per-query overrides for server parameters that control optimizer behavior (e.g. samplingMarginOfError, planRankerMode). They are set via the setQuerySettings command using the queryKnobs field. Each query knob maps to a ServerParameter defined in IDL, which may declare range constraints via a validator (e.g. gte: 1.0, lte: 10.0). Those constraints are enforced by ServerParameter::validate() whenever the parameter is changed globally via setParameter or setClusterParameter.
Description
The setQuerySettings path currently only validates that a knob name is PQS-settable and that the value can be deserialized into the correct C++ type. This ticket extends that validation to also enforce the IDL-defined range constraints for each knob, so that the per-query override path applies the same domain rules as the global parameter path.
Acceptance criteria
- setQuerySettings with a query knob value below its IDL minimum (e.g. samplingMarginOfError: 0.5, violating gte: 1.0) is rejected with error code 12194501.
- setQuerySettings with a query knob value above its IDL maximum (e.g. samplingMarginOfError: 10.1, violating lte: 10.0) is rejected with error code 12194501.
- setQuerySettings with a valid in-range value succeeds.
- Enum-typed knobs are unaffected (their validity was already enforced by fromBSON).
- Unit tests in query_knob_overrides_test.cpp: ValidatorRejectsOutOfRangeValue and ValidatorAcceptsInRangeValue.
- Integration tests in query_settings_query_knobs.js: two cases covering the above out-of-range rejections end-to-end.