[SERVER-80533] Pass serialization context into agg parseFromBSON from error_labels Created: 29/Aug/23  Updated: 29/Oct/23  Resolved: 08/Sep/23

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 7.2.0-rc0

Type: Task Priority: Major - P3
Reporter: Hugh Tong (Inactive) Assignee: Hugh Tong (Inactive)
Resolution: Fixed Votes: 0
Labels: ntdi_must_have
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by SERVER-73113 Allow only specific global dbs to be ... Closed
Assigned Teams:
Serverless
Backwards Compatibility: Fully Compatible
Sprint: Server Serverless 2023-09-18
Participants:

 Description   

isResumableChangeStreamError is not currently passing in a serialization context when calling aggregation_request_helper::parseFromBSON which can cause us to deserialize agg fields incorrectly.  In order to reach a valid request, we will need to go back up the call stack several layers and pass it down.

AggregateCommandRequest::parse()    <-- consumes sc here
    aggregation_request_helper::parseFromBSON() <-- no sc here
        ErrorLabelBuilder::isResumableChangeStreamError()
            ErrorLabelBuilder::build
                getErrorLabels
                    ParseAndRunCommand::_updateStatsAndApplyErrorLabels <-- request can be pulled from _rec
                    appendErrorLabelsAndTopologyVersion
                        ExecCommandDatabase::_handleFailure     <-- OpMsgRequest is available here
                        RunCommandImpl::_epilogue()             <-- OpMsgRequest is available here
 

We may consider pulling the VTS off the opCtx for this fix as a stopgap, but we likely want to pull it from the request where possible.  This change is in support of SERVER-73113, and can be tested by enabling the dbName assertions in that ticket.



 Comments   
Comment by Githook User [ 08/Sep/23 ]

Author:

{'name': 'Hugh Tong', 'email': 'hugh.tong@mongodb.com', 'username': 'cortrain'}

Message: SERVER-80533 Pass serialization context into agg parseFromBSON from error_labels
Branch: master
https://github.com/mongodb/mongo/commit/90cd8838c31d90d89b13b8db4783368a1acd15e8

Comment by Sophia Tan [ 31/Aug/23 ]

For this ticket, we are going to get the VTS from opCtxt.

We need to open another ticket to pass the serialization context to here in a proper way. 

Generated at Thu Feb 08 06:43:49 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.