[SERVER-74044] There are many ad-hoc interfaces and solutions for how to link mongod and mongos common code with mongod or mongos specific code, in order to avoid code duplication Created: 15/Feb/23  Updated: 05/Jan/24

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

Type: Improvement Priority: Major - P3
Reporter: Dianna Hohensee (Inactive) Assignee: Backlog - Catalog and Routing
Resolution: Unresolved Votes: 0
Labels: oldshardingemea, pm-635-milestone-3
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to SERVER-73274 create mongos commands for the four n... Closed
Assigned Teams:
Catalog and Routing
Participants:

 Description   

I think there are enough instances of this pattern to warrant work to provide a uniform means of achieving this.

These are some existing means of linking mongos and mongod logic separately, along with common logic in mongos and mongod

  • mongod_main.cpp and mongos_main.cpp
    • Typically for code that only starts up in one or the other, not common code
  • Interface with factory construction method like query’s MongoProcessInterface.
  • ServiceContext has ConstructorActionRegisterer.
    • Keeps code separate in their own files, don’t need factory classes.

Would be great to have a unified means of doing this. There are already a lot of separate instances.

Some existing command interfaces:

  • DBDirectClient
  • ShardRegistry
  • ConfigShard


 Comments   
Comment by Jordi Serra Torrens [ 21/Jul/23 ]

Moving to PM-635 as that project will do some work related to mongos/mongod linking.

Comment by Kaloian Manassiev [ 23/Feb/23 ]

Figuring out what to do next on this ticket is not a simple task and requires stepping back a bit to understand the commonality between these patterns and what they actually try to express.

I am proposing that we put it in the ShardRole project and from there split into smaller sub-tickets for each of the instances of the pattern, which dianna.hohensee@mongodb.com listed above (thank you, Diana).

Comment by Dianna Hohensee (Inactive) [ 15/Feb/23 ]

Kal proposed linking the DBDirectClient, which uses the ServiceEntryPoint (which has mongod and mongos implementations already), into the mongos so that a single interface can be leveraged for code common to both mongod and mongos.

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