[SERVER-76614] Investigate moving the validate command to IDL Created: 27/Apr/23  Updated: 22/Jan/24  Resolved: 22/Jan/24

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

Type: Task Priority: Major - P3
Reporter: Hugh Tong (Inactive) Assignee: Backlog - Service Architecture
Resolution: Won't Fix Votes: 0
Labels: ntdi_nice_to_have
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to SERVER-80641 validate command has no tenant prefix... Closed
Assigned Teams:
Service Arch
Participants:

 Description   

The validate command does not currently have access an OpMsgRequest in order to reliably access the `ValidatedTenancyScope`.  We use this to populate the SerializationContext object for building command replies, which generally happens closer to the end of the operation.  While we can currently access the `ValidatedTenancyScope` on the opCtx, this is not ideal as the `ValidatedTenancyScope` only exists on the opCtx if the thread holding this opCtx  obj processed the request at the service entry point.

While we can currently access the `ValidatedTenancyScope` on the opCtx for the validate command, this may not necessarily be true for all commands, so Service Arch has recommended changing the currently hand-rolled command to an IDL type to take advantage of the `TypedCommand` interface, which provides access to the OpMsgRequest.  We need to check with Storage Execution if they are good with this, and investigate what it would take to port this command over, paving the way for porting other commands that may actually encounter issues with pulling the `ValidatedTenancyScope` off the opCtx.



 Comments   
Comment by Didier Nadeau [ 22/Jan/24 ]

We are not going to refactor old commands to use TypedCommand unless it is strictly necessary for NTDI.

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