[SERVER-43361] Remove compatibility for 4.2 $sortKey format Created: 16/Sep/19  Updated: 29/Oct/23  Resolved: 25/Mar/20

Status: Closed
Project: Core Server
Component/s: Querying
Affects Version/s: None
Fix Version/s: 4.7.0

Type: Improvement Priority: Major - P3
Reporter: Justin Seyster Assignee: David Storch
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to SERVER-43669 $meta:"sortKey" expressions can gener... Closed
related to SERVER-47065 Remove 'use44SortKeys' flag from Quer... Closed
Backwards Compatibility: Fully Compatible
Sprint: Query 2020-03-23, Query 2020-04-06
Participants:

 Description   

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.


 Comments   
Comment by Githook User [ 25/Mar/20 ]

Author:

{'email': 'david.storch@mongodb.com', 'name': 'David Storch', 'username': 'dstorch'}

Message: SERVER-43361 Remove compatibility with 4.2 sort key format

This logic was necessary in 4.4 to support the 4.2/4.4
upgrade/downgrade process. A 4.6 node can always use the new
array-based sort key format, since it never communicates
with a 4.2 mongos or mongod.
Branch: master
https://github.com/mongodb/mongo/commit/5b8b35ecebeb019cd09fb0623a407b08ec2f3a09

Generated at Thu Feb 08 05:02:59 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.