[SERVER-1822] Eliminate duplicate symbols between mongod and mongos files Created: 21/Sep/10  Updated: 06/Dec/22  Resolved: 25/Jan/18

Status: Closed
Project: Core Server
Component/s: Internal Code
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: Alberto Lerner Assignee: [DO NOT USE] Backlog - Sharding Team
Resolution: Incomplete Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
depends on SERVER-1853 Command have a run and runSharded method Closed
is depended on by SERVER-1582 add more things to "features" command Closed
Assigned Teams:
Sharding
Participants:

 Description   

Currently it is not possible to link an executable before it decides if it wants to be a mongod or a mongos.

The underlying reason is that some symbols are implement in one way in a mongod and in a different way in a mongo's. There are three reasons I can list for that (I'll attach a list of symbols after this; I just want to get a JIRA number for this now.)
1. some commands that should behave accordingly (e.g., listDatabases)
2. some symbols have no reason to exist if in a mongod (e.g, see everything that's on s/s_only.cpp)
3. some symbols just belong at once to two different libraries in SConstruct (e.g.

Implications of this approach are several, the one that motivated this JIRA in particular is that writing dbtest for mongos code is a bit tricky today, perhaps possible, but with too many link-related pitfalls.

A suggestion here is to address 1-3 above, in particular making it easier to enrich the dbtest/ directory as we go.



 Comments   
Comment by auto [ 01/Oct/10 ]

Author:

{'login': 'alerner', 'name': 'Alberto Lerner', 'email': 'alerner@10gen.com'}

Message: SERVER-1822 dedup check/resetShardVersion and kill s/d_util.cpp
http://github.com/mongodb/mongo/commit/a6b0eee2c0632e326ec1929d28be1645ee94d455

Comment by auto [ 01/Oct/10 ]

Author:

{'login': 'alerner', 'name': 'Alberto Lerner', 'email': 'alerner@10gen.com'}

Message: SERVER-1822 pull out WriteBackListener, next dedup will use it
http://github.com/mongodb/mongo/commit/9076c182ecfeea0985ba0fa3ae736092a2e81b6d

Comment by auto [ 01/Oct/10 ]

Author:

{'login': 'alerner', 'name': 'Alberto Lerner', 'email': 'alerner@10gen.com'}

Message: SERVER-1822 dedup webGetAdminUser/webHaveAdminUser
http://github.com/mongodb/mongo/commit/b5e3087817a7c8e0954bde0ff019fec1a27ea7ba

Comment by Alberto Lerner [ 21/Sep/10 ]

The windows linker's output detects instances of the three cases. Here are the ones I bumped into (but there may be others):

1. Commands (dbcommands.cpp and s/commands_admin.cpp, when not otherwise noted)
+ CmdCloseAllDatabases
+ CmdListDatabases
+ cmdCursorInfo (db/clientcursor.cpp and s/cursor.cpp)

2a. No-ops in mongod (in s/s_only.cpp and ...)
+ execCommand (...dbcommands.cpp)
+ currentClient (...client.cpp)
+ Client::shutdown (...client.cpp)
+ Client::Client/~Client (...client.cpp)
SOLVED + webGetAdminUser (...restapi.cpp)
SOLVED + webHaveAdminUser(...restapi.cpp)

2b. Noops in mongos (in s/d_util.cpp and...)
SOLVED + check/resetShardVersion (...strategy.cpp)
+ getDBContext (pdfile.cpp and s/server.cpp)
+ Helpers::Find (dbhelpers.cpp and s_only.cpp)

3. Double symbol inclusion
+ getDbContext (pdfile.cpp in lib ... and s/server.cpp)
+ dbexit (instance.cpp in lib ... and s/server.cpp)
+ inshutdown (instance.cpp in lib... and s/server.cpp)
+ createDirectClient (instance.cpp in lib... and s/server.cpp)

Comment by auto [ 21/Sep/10 ]

Author:

{'login': 'alerner', 'name': 'Alberto Lerner', 'email': 'alerner@10gen.com'}

Message: allow dbtests for sharded code as well (revert SConstruct manually, defer to SERVER-1822, but allow SERVER-1713 to proceed)
http://github.com/mongodb/mongo/commit/b356a7fc8a203eb23147658dcd60fc4c275e3091

Generated at Thu Feb 08 02:58:09 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.