[SERVER-12235] Don't require a database read on every new localhost connection when auth is on Created: 02/Jan/14  Updated: 19/Sep/15  Resolved: 26/Feb/15

Status: Closed
Project: Core Server
Component/s: Security
Affects Version/s: 2.4.8, 2.5.4
Fix Version/s: 3.0.3, 3.1.0

Type: Improvement Priority: Major - P3
Reporter: Spencer Brody (Inactive) Assignee: Matt Dannenberg
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
is duplicated by SERVER-17845 Running the dropDatabase command can ... Closed
Related
is related to SERVER-12236 Don't query admin.system.users on new... Closed
is related to SERVER-17034 Deadlock between poorly-formed copydb... Closed
is related to SERVER-18415 Dropping admin user doesn't reenable ... Closed
Backwards Compatibility: Fully Compatible
Backport Completed:
Participants:

 Description   

Currently, anytime an access-control enabled mongod or mongos receive a new connection from localhost, it must issue a query against admin.system.user to determine if there are any users defined in the system, and thus whether or not to grant the connection full access according to the localhost auth bypass.

If we determine that there is in fact a user defined, and thus the localhost exception should not be in effect, we cache that information on the connection so that that connection does not have to query admin.system.users for this purpose again.

We should instead cache the existence of an admin user process-wide so it only needs to be checked once, not once on every new connection.



 Comments   
Comment by Githook User [ 09/Apr/15 ]

Author:

{u'username': u'stbrody', u'name': u'Spencer T Brody', u'email': u'spencer@mongodb.com'}

Message: SERVER-12235 Cache whether any users exist for checking whether the localhost exception should be in effect
Branch: v3.0
https://github.com/mongodb/mongo/commit/f7e1ed8a4c8e0952ceeec225e3ff323008eeab0c

Comment by Githook User [ 08/Apr/15 ]

Author:

{u'username': u'ramonfm', u'name': u'Ramon Fernandez', u'email': u'ramon.fernandez@mongodb.com'}

Message: Revert "SERVER-12235 Cache whether any users exist for checking whether the localhost exception should be in effect"

This reverts commit ebb1fd748b02c90453d2933430f3345edec9ee9c.
Branch: v3.0
https://github.com/mongodb/mongo/commit/83c4ca903b22e18517ab80c98777da23fd1f6aae

Comment by Githook User [ 08/Apr/15 ]

Author:

{u'username': u'stbrody', u'name': u'Spencer T Brody', u'email': u'spencer@mongodb.com'}

Message: SERVER-12235 Cache whether any users exist for checking whether the localhost exception should be in effect
Branch: v3.0
https://github.com/mongodb/mongo/commit/ebb1fd748b02c90453d2933430f3345edec9ee9c

Comment by Amalia Hawkins [ 03/Apr/15 ]

schwerin, based on the outcome of SERVER-17845, I'd like to request that we backport this patch to the 3.0 branch.

Comment by Andy Schwerin [ 03/Mar/15 ]

spencer, I'm not inclined to backport this to 3.0 branch. If you think there's a strong reason to backport it, please re-request backport and describe your reason in the comments.

Comment by Githook User [ 26/Feb/15 ]

Author:

{u'username': u'stbrody', u'name': u'Spencer T Brody', u'email': u'spencer@mongodb.com'}

Message: SERVER-12235 Cache whether any users exist for checking whether the localhost exception should be in effect
Branch: master
https://github.com/mongodb/mongo/commit/85d2238a163249f7d8e2c26933681b4374af19d0

Comment by Spencer Brody (Inactive) [ 27/Jan/15 ]

It seems like checking for the presence of user docs every time a new connection is established could be contributing to replica set failovers in overloaded systems. Implementing this ticket will eliminate that behavior and should help reduce the spurious failovers. Thus bumping this to 3.1.0 and marking for backport to 3.0.x.

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