[SERVER-66708] Ensure deserializer methods for IDL defined types that construct NamespaceString have access to tenantId Created: 23/May/22  Updated: 29/Oct/23  Resolved: 25/Aug/22

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

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

Issue Links:
Depends
is depended on by SERVER-68721 Pass tenantId from NamespaceString in... Closed
Related
related to SERVER-68848 IDLParserContext unary constructor mi... Closed
Backwards Compatibility: Fully Compatible
Sprint: Server Serverless 2022-08-08, Server Serverless 2022-08-22, Server Serverless 2022-09-05
Participants:

 Description   

We construct operations from oplog entries, which relies on deserializing or parsing the flattened entries.  This means the parser needs to understand that a "tid:" field may exist, and to pass it into the deserializer method.  Parsing for oplog entries is performed by autogenerated code configured via oplog_entry.idl, which currently iterates through all the fields in the oplog entry and passes the value associated with that field into the deserializer.  However, when constructing NamespaceString objects, we rely on both the "tid:" and the "ns:" fields to pass in as parameters, which this iterating process does not allow for.

Instead, we would like to add the tenantId field into an existing parameter being passed into the parser, IDLParserContext, and populate the tenantId as we construct the context.  This places the onus of retrieving the tenantId on the caller, which is fine as not all callers will need to be tenantId aware, but could affect a number of call sites.  Specifically for oplog entries, these call sites are limited to DurableOplogEntry::parse(), MutableOplogEntry::parse() (base class for DurableOplogEntry), and OplogEntry:parse().

Changes to the autogenerated code are also required as we need the parser to retrieve the tenantId from the IDLParserContext, and pass it in as the first parameter to the deserializer, along with the namespace string value.



 Comments   
Comment by Githook User [ 18/Aug/22 ]

Author:

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

Message: SERVER-66708 Ensure deserializer methods for IDL defined types that construct NamespaceString have access to tenantId
Branch: master
https://github.com/mongodb/mongo/commit/c81e869007aa7658ffdd57aade363b93b0c04278

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