Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-78904

Modify createWithValidatedTenancyScope to utilize SerializationContext objs

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 7.1.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • Fully Compatible
    • Server Serverless 2023-07-24, Server Serverless 2023-08-07, Server Serverless 2023-08-21

      createWithValidatedTenancyScope returns an OpMsgRequest with a validated tenancy scope by using the original request as a template to build upon.  It currently calls two other sub-functions, appendDollarDbAndTenant and appendDollarTenant, all of which are used to serialize $tenant and $db fields for OpMsgRequests.  However, they currently call DatabaseNameUtil::serialize() without serialization contexts to form the $db field, and rely on the feature flag to form the $tenant field, which can lead to incorrect/inconsistent prefixing.  They also do not currently form expectPrefix fields (though we would likely want to just pass the field from the original request if it is present).

      Because the original request will have previously been parsed, the request object will contain a SerializationContext object.  We should use this SerializationContext to build $tenant and $db fields, and pass expectPrefix to the created request if it exists.

       

            Assignee:
            hugh.tong@mongodb.com Hugh Tong (Inactive)
            Reporter:
            hugh.tong@mongodb.com Hugh Tong (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: