[SERVER-20636] Move Command::testCommandsEnabled definition to its own library Created: 25/Sep/15  Updated: 15/Oct/15  Resolved: 07/Oct/15

Status: Closed
Project: Core Server
Component/s: Internal Code
Affects Version/s: 3.1.8
Fix Version/s: 3.2.0-rc0

Type: Task Priority: Major - P3
Reporter: Max Hirschhorn Assignee: Max Hirschhorn
Resolution: Done Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Sprint: TIG A (10/09/15)
Participants:

 Description   

commands.cpp is build as part of the coredb library: https://github.com/mongodb/mongo/blob/r3.1.8/src/mongo/db/SConscript#L477. Some tests include commands.h and define a value for Command::testCommandsEnabled to avoid linking it in. It would be nice to make determining whether the server is in test mode (i.e. whether test commands are enabled) a more reasonable thing to do from a linkage perspective.

This will be used by mongobridge to change dbclient.cpp and network_interface_asio_auth.cpp to include the server's host info in the initial isMaster command request only if the server is in test mode.



 Comments   
Comment by Githook User [ 13/Oct/15 ]

Author:

{u'username': u'visemet', u'name': u'Max Hirschhorn', u'email': u'max.hirschhorn@mongodb.com'}

Message: SERVER-20636 Avoid duplicate definition of Command::testCommandsEnabled.
Branch: artree
https://github.com/10gen/mongo-enterprise-modules/commit/d3933424929bc7679292505e37546e9d9f2411c1

Comment by Githook User [ 07/Oct/15 ]

Author:

{u'username': u'visemet', u'name': u'Max Hirschhorn', u'email': u'max.hirschhorn@mongodb.com'}

Message: SERVER-20636 Avoid duplicate definition of Command::testCommandsEnabled.
Branch: master
https://github.com/10gen/mongo-enterprise-modules/commit/d3933424929bc7679292505e37546e9d9f2411c1

Comment by Githook User [ 07/Oct/15 ]

Author:

{u'username': u'visemet', u'name': u'Max Hirschhorn', u'email': u'max.hirschhorn@mongodb.com'}

Message: SERVER-20636 Move Command::testCommandsEnabled to its own library.

Resolves some linkage debt to make it easier to check whether test
commands are enabled in the server.
Branch: master
https://github.com/mongodb/mongo/commit/738c366cc7a2af55dbeef2fce83a64653f5819e0

Comment by Max Hirschhorn [ 06/Oct/15 ]

Based on discussions with Andy and Adam, we've decided to abandon the approach of having testCommandsEnabled being a decoration on the global service context. The mongo shell isn't allowed to have a ServiceContext, and having DBClientConnection taking a function to produce the initial isMaster command request is a more involved change than what is necessary for the mongobridge improvements.

Instead, the definition of the static member Command::testCommandsEnabled will be moved to its own library. Updating the summary of this ticket to reflect this.

Generated at Thu Feb 08 03:54:49 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.