[SERVER-81551] Move the OpMsgRequest parsing above ServiceEntryPoint::handleRequest() Created: 28/Sep/23  Updated: 07/Feb/24

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

Type: Task Priority: Major - P3
Reporter: Cheahuychou Mao Assignee: Backlog - Service Architecture
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to SERVER-81968 Make mongod dispatch commands through... Closed
Assigned Teams:
Service Arch
Participants:

 Description   

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.


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