Using Bson_serialization_type “any” means that idl compatibility checker script can’t do any type checking, since that logic is in cpp, so we want to disallow this type from parameters/reply fields as a result.
However, lots of commands actually use it for valid reasons.
For now we added some exceptions to allow using Bson_serialization_type “any” in our idl_checker script, these are the lisf of fields that still using Bson_serialization_type “any” that require your attention:
src/mongo/db/explain.idl
- The 'explain'' command has parameter 'collation' that has type 'IDLAnyType'
- The 'explain'' command has parameter 'use44SortKeys' that has type 'IDLAnyType'
- The 'explain'' command has parameter 'useNewUpsert' that has type 'IDLAnyType'
src/mongo/db/ops/write_ops.idl
- 'update' has a reply field '_id' of type 'IDLAnyTypeOwned'
- The 'findAndModify'' command has parameter 'hint' that has type 'indexHint'
- The 'findAndModify'' command has parameter 'update' that has type 'update_modification'
- 'findAndModify' has a reply field 'upserted' of type 'IDLAnyTypeOwned'
- 'delete' command has a parameter of type 'DeleteOpEntry' which has 'limit' and 'hint'
src/mongo/db/pipeline/aggregate_command.idl:
- The 'aggregate'' command has parameter 'pipeline' that has type 'pipeline'
- The 'aggregate'' command has parameter 'explain' that has type 'explainVerbosity'
- The 'aggregate'' command has parameter 'allowDiskUse' that has type 'optionalBool'
- The 'aggregate'' command has parameter 'cursor' that has type 'aggregateCursor'
- The 'aggregate'' command has parameter 'hint' that has type 'indexHint'
- The 'aggregate'' command has parameter 'needsMerge' that has type 'optionalBool'
- The 'aggregate'' command has parameter 'fromMongos' that has type 'optionalBool'
- The 'aggregate'' command has parameter '$_requestReshardingResumeToken' that has type 'optionalBool'
- The 'aggregate'' command has parameter 'isMapReduceCommand' that has type 'optionalBool'
- 'aggregate' has a reply field 'partialResultsReturned' of type 'optionalBool'
src/mongo/db/query/find_command.idl
- The 'find'' command has parameter 'filter' that has type 'object_owned_nonempty_serialize'
- The 'find'' command has parameter 'projection' that has type 'object_owned_nonempty_serialize'
- The 'find'' command has parameter 'sort' that has type 'object_owned_nonempty_serialize'
- The 'find'' command has parameter 'hint' that has type 'indexHint'
- The 'find'' command has parameter 'collation' that has type 'object_owned_nonempty_serialize'
- The 'find'' command has parameter 'singleBatch' that has type 'optionalBool'
- The 'find'' command has parameter 'allowDiskUse' that has type 'optionalBool'
- The 'find'' command has parameter 'min' that has type 'object_owned_nonempty_serialize'
- The 'find'' command has parameter 'max' that has type 'object_owned_nonempty_serialize'
- The 'find'' command has parameter 'returnKey' that has type 'optionalBool'
- The 'find'' command has parameter 'showRecordId' that has type 'optionalBool'
- The 'find'' command has parameter '$queryOptions' that has type 'object_owned_nonempty_serialize'
- The 'find'' command has parameter 'tailable' that has type 'optionalBool'
- The 'find'' command has parameter 'oplogReplay' that has type 'boolNoOpSerializer'
- The 'find'' command has parameter 'noCursorTimeout' that has type 'optionalBool'
- The 'find'' command has parameter 'awaitData' that has type 'optionalBool'
- The 'find'' command has parameter 'allowPartialResults' that has type 'optionalBool'
- The 'find'' command has parameter 'readOnce' that has type 'optionalBool'
- The 'find'' command has parameter 'allowSpeculativeMajorityRead' that has type 'optionalBool'
- The 'find'' command has parameter '$_requestResumeToken' that has type 'optionalBool'
- The 'find'' command has parameter '$_resumeAfter' that has type 'object_owned_nonempty_serialize'
- The 'find'' command has parameter 'maxTimeMS' that has type 'maxTimeMS'
- 'find' has a reply field 'partialResultsReturned' of type 'optionalBool'
Take a look at these fields and try to identify which ones can be converted away from using Bson_serialization_type “any”, and which ones must keep using it.
Here are the two outcomes:
1- if the field can be converted:
- This change should be done before 5.0 (if the field is "stable") as this will be the realese for API stable Version 1
- The exception for that field should be removed from idl_checker script (TODO will be added with this ticket number).
2- if the field can't be converted, or the change can't be done before 5.0.
- The type of that field type should stay of Bson_serialization_type “any” and can't be changed later for any reason unless it is defined as "unstable".
- We need to put comments on the serialization/deserialization to prevent the behavioral changes (preferably to add tests to ensure that.)
- related to
-
SERVER-56016 Complete TODO listed in SERVER-54925
- Closed