After branching for 4.4, the new branch will no longer need to support the wire format for change streams $sortKeys used in 4.2. We will be able to remove any FCV checks and other compatibility checks used to support the old format.
Update: As part of SERVER-43669, we added more changes to how sort keys are communicated back to the merging node, and those changes come with more upgrade/downgrade compatibility code that will be obsolete after branching for 4.5.
- There is now a 'SortKeyFormat' enum that should be deleted as part of this ticket. Also delete the 'sortKeyFormat' member of the ExpressionContext.
- There are switch statements in document_value/document.cpp, return_key.cpp, and pipeline/expression.cpp that choose which serialization function to use based on the 'sortKeyFormat' value. These switch statements can be replaced with a call to serializeSortKeyAsArray().
- The serializeSortKeyAsObject() function will be obsolete and can be deleted.
- The 'sortKeyFormat' argument to Document::toBSONWithMetadata() can also be deleted.
- The "use44SortKeys" property of AggregationRequest and QueryRequest can be deleted, along with associated accessors and string constants.
- The if statements in find_cmd.cpp and run_aggregate.cpp that initialize the 'sortKeyFormat' property of ExpressionContext can be deleted. These if statements are each marked with a TODO that references this ticket.
- related to
-
SERVER-43669 $meta:"sortKey" expressions can generate BSON with duplicate field names which are not correctly handled by Document/Value class
- Closed
-
SERVER-47065 Remove 'use44SortKeys' flag from QueryRequest and AggregationRequest in 4.7
- Closed