[SERVER-65459] Construct NamespaceString using tenantId on the OpMsgRequest during command parsing for IDL defined commands Created: 11/Apr/22 Updated: 29/Oct/23 Resolved: 14/Jul/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: | Sophia Tan |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||||||||||
| Sprint: | Server Serverless 2022-05-30, Server Serverless 2022-06-13, Server Serverless 2022-06-27, Server Serverless 2022-07-11, Server Serverless 2022-07-25 | ||||||||||||||||
| Participants: | |||||||||||||||||
| Linked BF Score: | 168 | ||||||||||||||||
| Description |
|
For any commands that use concatenate_with_db, we'll pass the tenantId, if it exists on the opMsgRequest, to the NamespaceString constructor. In order to do this, we'll need to pass tenantId to gen_namespace_check() (we'll need to pass it through _gen_command_deserializer())- it can default to None for both functions. In CommandWithNamespaceTypeInfo::gen_namespace_check(), pass this tenantId to IDLParserErrorContext::parseNSCollectionRequired. We'll have to add tenantId as an optional parameter to IDLParserErrorContext::parseNSCollectionRequired. Once this is done, we should be able to successfully run some commands on a standalone mongod (or perhaps a single node RS) using either a securityToken or the $tenant field to pass the tenantId. Only commands which are IDL defined will work at this point, let's write a simple workload that runs create collection, some CRUD ops, and find commands using both the securityToken and $tenant. Here are the example idl generated cpp code: - for constructing the "to" field of "renameCollection"
- for constructing the nss from command feild of "renameCollection" cmd. Its cmd namespace is "namespace: type".
- for constructing the nss from db name and command field of "insert" cmd. Its cmd namespace is "namespace: concatenate_with_db".
|
| Comments |
| Comment by Githook User [ 13/Jul/22 ] |
|
Author: {'name': 'Sophia Tan', 'email': 'sophia_tll@hotmail.com', 'username': 'sophiatll'}Message: |
| Comment by Githook User [ 12/Jul/22 ] |
|
Author: {'name': 'jannaerin', 'email': 'golden.janna@gmail.com', 'username': 'jannaerin'}Message: Revert " This reverts commit c340d5a7a891758510728997c839f8e8d7e5eaa0. |
| Comment by Githook User [ 11/Jul/22 ] |
|
Author: {'name': 'Sophia Tan', 'email': 'sophia_tll@hotmail.com', 'username': 'sophiatll'}Message: |