[SERVER-67545] When auth is disabled, _mayBypassWriteBlockingMode should be set to true Created: 27/Jun/22  Updated: 29/Oct/23  Resolved: 29/Aug/22

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 6.2.0-rc0

Type: Improvement Priority: Major - P3
Reporter: Jenny Ren (Inactive) Assignee: Adam Rayner
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Sprint: Security 2022-07-11, Security 2022-07-25, Security 2022-09-05
Participants:

 Description   

https://jira.mongodb.org/browse/SERVER-63174

The above ticket introduced logic to compute _mayBypassWriteBlockingMode, however, the logic is invoked even when auth is disabled, which incurs a small (and unnecessary) performance overhead. _mayBypassWriteBlockingMode should be directly set to true when auth is disabled.



 Comments   
Comment by Githook User [ 26/Aug/22 ]

Author:

{'name': 'Adam Rayner', 'email': 'adam.rayner@gmail.com'}

Message: SERVER-67545 only refresh mayBypassWriteBlockingMode when auth is enabled
Branch: master
https://github.com/mongodb/mongo/commit/c53c0cf2dbea9ea36af6746f59b7f3647370e210

Comment by Daniel Gottlieb (Inactive) [ 27/Jul/22 ]

Hi adam.rayner@mongodb.com,

We did see a perf hit due to this cost. It's significant in some contexts, but not in others. To elaborate:

  • This shows up when profiling a low number of concurrent readers on a standalone – obviously without auth. Probably shows up in more interesting workloads as well.
  • That workload isn't indicative of a recommended customer workload due to auth being disabled.
  • We see about a 1% performance hit due to the unnecessary auth checks.
  • To put in context, this is a top-3 issue we've identified. Each costing us roughly 1-2%

I too am not particularly concerned with fixing this for the sake of being hygienic. My main motivation to address this is to remove the noise when profiling in an effort to make performance improvements. If this is deemed a safe change anyone can make, I'm happy to take it on myself.

Comment by Adam Rayner [ 15/Jul/22 ]

jenny.ren@mongodb.com thanks for raising this, but after internal discussion with the team I am closing this as won't do:

  • We only populate _mayBypassWriteBlockingMode in _updateInternalAuthorizationState which is only used to manage authorization state - it may be possible to authenticate to a server without --auth, but this is not a server state we are too concerned about optimizing
  • Looking at the code in the PR, the code path in question is not especially hot and If there is no other data on the performance involved here then we consider this to be a micro-optimization

Certainly if there is additional performance information driving this request, let me know and happy to re-evaluate these assumptions.

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