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

Use original request's SerializationContext in FindKeyGenerator::reparse

    • Type: Icon: Task Task
    • Resolution: Cannot Reproduce
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Service Arch

      FindKeyGenerator::reparse creates a new request by serializing the dbName object parsed from a _parseableQueryShape object.  The parseableQueryShape is a BSON object that is created internally via query_shape::extractQueryShape and follows serializing for storage conventions, which means the accessed nss.dbName() is correctly formed.

      However, reparse builds the $db field in the new request BSONObj by calling DatabaseNameUtil::serialize(nss.dbName()) without a serialization context, which means it is subject to storage rules (ie. tenantId feature flag) and can be prefixed.  If it's not prefixed, the tenantId isn't added to the BSONObj and could potentially be lost, as boost::none is passed into the FindRequestCommand::parse() function.

      We should first store the serialization context from the original request into FindKeyGenerator as this contains the context of how the tenantId was initially retrieved, then extract the tenantId from the nss and pass that into the parse() function along with the serialization context.

            Assignee:
            backlog-server-servicearch [DO NOT USE] Backlog - Service Architecture
            Reporter:
            hugh.tong@mongodb.com Hugh Tong (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: