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

Move the OpMsgRequest parsing above ServiceEntryPoint::handleRequest()

    • Type: Icon: Task Task
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None
    • Service Arch
    • Service Arch 2024-04-01, Service Arch 2024-04-15

      PM-2965 seeks to allow users to connect to a single-shard cluster using a replica set connection string, i.e. one that points to the non-router port. That is, for a client connected to the router port, mongod will return mongos hello responses and service commands using the router code paths as usual. However, for a client connected to the non-router port, mongod will return mongod hello responses but service commands using the router code paths (i.e. ServiceEntryPointMongos) instead of the shard code paths (i.e. ServiceEntryPointCommon) except in the following cases:

      1. The command is not available on a router (here)
      2. The command node-specific command (here).
      3. The command is for the “local” database.
      4. The command is coming from an internal client.

      That is, to know whether a request coming through the non-router port should be handled using ServiceEntryPointCommon or ServiceEntryPointMongos, we need to know what command it corresponds to and what database it is for. To get that information, we need to parse the Message into OpMsgRequest. However, currently the parsing is done separately later inside ServiceEntryPointCommon::handleRequest() or ServiceEntryPointMongod::handleRequest(). The proposal here is move the parsing above handleRequest() so we can implement the dispatching inside the ServiceEntryPointMongod.

            Assignee:
            george.wangensteen@mongodb.com George Wangensteen
            Reporter:
            cheahuychou.mao@mongodb.com Cheahuychou Mao
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated: