[SERVER-27211] de-duplicate multiply defined symbol `isMongos` Created: 29/Nov/16  Updated: 05/Apr/17  Resolved: 05/Dec/16

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

Type: Improvement Priority: Major - P3
Reporter: Matt Cotter Assignee: ADAM Martin (Inactive)
Resolution: Done Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by SERVER-23103 Make library dependency graph acyclic Closed
Backwards Compatibility: Fully Compatible
Sprint: Platforms 2017-01-23
Participants:
Linked BF Score: 0

 Comments   
Comment by Githook User [ 06/Dec/16 ]

Author:

{u'username': u'dgottlieb', u'name': u'Daniel Gottlieb', u'email': u'daniel.gottlieb@10gen.com'}

Message: SERVER-27211: Add copyright header to is_mongos.cpp
Branch: master
https://github.com/mongodb/mongo/commit/188f2fe21053be56cc325c03b2c5aebeef7ef377

Comment by Githook User [ 05/Dec/16 ]

Author:

{u'username': u'adamlsd', u'name': u'ADAM David Alan Martin', u'email': u'adam.martin@10gen.com'}

Message: SERVER-27211 de-duplicate symbol `isMongos`

A hidden global variable representing the "is Mongos process" state
can now be accessed and updated by the `is_mongos.h` interface. All
tests defining their own versions (and test crutches) are replaced
with calls to global registration of the desired state of this variable.
The `mongos` main executable now sets this hidden global state as part
of its startup code.
Branch: master
https://github.com/mongodb/mongo/commit/20ce1aa922673f758cc6c2edc47146c6314a4f57

Comment by Matt Cotter [ 29/Nov/16 ]

The views test crutch will go away. (or if there are other crutches that define more than just isMongos, they will be reduced)

For a first stab, we planned to make it a global (which it sort of is already) because plumbing service contexts down to the unit tests where isMongos gets called would be a big diff. The goal of this effort is to remove multiply defined symbols and not necessarily to fix everything wrong with isMongos.

We will definitely consider the possibility though.

Comment by Kyle Suarez [ 29/Nov/16 ]

In addition, what does that mean for test crutches like this one?

Comment by Andy Schwerin [ 29/Nov/16 ]

Is the plan to decorate the service context, or to cleverly eliminate it entirely?

Generated at Thu Feb 08 04:14:28 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.