Details
-
Bug
-
Resolution: Fixed
-
Major - P3
-
None
-
None
-
None
-
Fully Compatible
-
ALL
-
Sharding NYC 2023-04-17
Description
The callback for onInsert, onUpdate and onDelete for the config.queryAnalyzers or config.mongos collections in the QueryAnalysisOpObserver all involve parsing the document BSONobj into the corresponding IDL types. If the document doesn't have the expected fields, the parser would thrown an error and cause the server to crash because onCommit() is noexcept. Users are unlikely to ever write to these internal collections but it is still important to prevent such issue from happening. That is, the document BSONObj should get parsed outside of the callback to make the write fail earlier with a uassert instead of later during commit time.