[SERVER-43721] Make AuthorizationManager use DistCache Created: 30/Sep/19  Updated: 29/Oct/23  Resolved: 17/Jan/20

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

Type: New Feature Priority: Major - P3
Reporter: Kevin Pulo Assignee: Kaloian Manassiev
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by SERVER-45341 InvalidatingLRUCache should remove ac... Closed
Duplicate
is duplicated by SERVER-45066 Crashes in AuthorizationManagerImpl w... Closed
Related
related to SERVER-45066 Crashes in AuthorizationManagerImpl w... Closed
Backwards Compatibility: Fully Compatible
Sprint: Sharding 2020-01-13, Sharding 2020-01-27
Participants:
Linked BF Score: 16

 Comments   
Comment by Githook User [ 17/Jan/20 ]

Author:

{'username': 'kaloianm', 'name': 'Kaloian Manassiev', 'email': 'kaloian.manassiev@mongodb.com'}

Message: SERVER-43721 Rename DistCache to ReadThroughCache

rename src/mongo/util/

{dist_cache.cpp => read_through_cache.cpp}

(84%)
rename src/mongo/util/

{dist_cache.h => read_through_cache.h}

(90%)
rename src/mongo/util/

{dist_cache_test.cpp => read_through_cache_test.cpp}

(88%)
Branch: master
https://github.com/mongodb/mongo/commit/82729cb76e65800e9e4eaaeaa0e41d1b5b0e9021

Comment by Githook User [ 16/Jan/20 ]

Author:

{'name': 'Gabriel Russell', 'username': 'gabrielrussell', 'email': 'gabriel.russell@mongodb.com'}

Message: Revert "SERVER-43721 Rename DistCache to ReadThroughCache"

This reverts commit 4ea0e5f400e2dc8a18c2cf407f13e7780d0c5d14.
Branch: master
https://github.com/mongodb/mongo/commit/64659579638c97e7e57b139641f75d6b3e5117ad

Comment by Githook User [ 16/Jan/20 ]

Author:

{'name': 'Kaloian Manassiev', 'username': 'kaloianm', 'email': 'kaloian.manassiev@mongodb.com'}

Message: SERVER-43721 Rename DistCache to ReadThroughCache

No functional changes, just rename.

rename src/mongo/util/

{dist_cache.cpp => read_through_cache.cpp}

(84%)
rename src/mongo/util/

{dist_cache.h => read_through_cache.h}

(90%)
rename src/mongo/util/

{dist_cache_test.cpp => read_through_cache_test.cpp}

(88%)
Branch: master
https://github.com/mongodb/mongo/commit/4ea0e5f400e2dc8a18c2cf407f13e7780d0c5d14

Comment by Githook User [ 16/Jan/20 ]

Author:

{'name': 'Kaloian Manassiev', 'username': 'kaloianm', 'email': 'kaloian.manassiev@mongodb.com'}

Message: SERVER-43721 Make the AuthorizationManager use DistCache

The DistCache (to be later renamed to ReadThroughCache) was derived from
the same implementation under AuthorizationManager and this change
removes the code duplication.

In addition, it makes the following changes to InvalidatingLRUCache and
the DistCache:

  • Simplifies and optimises the InvalidatingLRUCache:

The way it is implemented now, it performs up to 3 operations per
lookup, unvalidates entries unnecessarily and has overly complicated
logic, which is source of a crash. Instead of fixing the bug, this
change rewrites it in a simpler way, which introduces a ValueHandle
instead of bare shared_ptr for the return value, and only performs
additional work if entries fall off the underlying LRUCache.

  • Moves the DistCache under src/util and adds unit tests:

This change pulls the DistCache (which is the main consumer of
InvalidatingLRUCache) into its own library and moves it to be
under src/util like the other caches and adds unit tests.

delete mode 100644 jstests/auth/pinned_users.js
create mode 100644 jstests/auth/pinned_users_clear_pinned_user_list.js
create mode 100644 jstests/auth/pinned_users_exclusive_lock_on_admin.js
create mode 100644 jstests/auth/pinned_users_remove_user_document_unpins_user.js
create mode 100644 src/mongo/util/dist_cache.cpp
rename src/mongo/

{db => util}

/dist_cache.h (56%)
create mode 100644 src/mongo/util/dist_cache_test.cpp
Branch: master
https://github.com/mongodb/mongo/commit/73b89c6fc4ed6279b52e2588c102c7fc1182189b

Comment by Githook User [ 06/Jan/20 ]

Author:

{'name': 'Kaloian Manassiev', 'email': 'kaloian.manassiev@mongodb.com', 'username': 'kaloianm'}

Message: SERVER-43721 Do not include lru_cache.h in 'encrypted_dbclient_base.cpp'
Branch: master
https://github.com/mongodb/mongo/commit/62ceffda0dcd90ccc7209b51e89872a7045b7c0e

Comment by Githook User [ 06/Jan/20 ]

Author:

{'name': 'Kaloian Manassiev', 'email': 'kaloian.manassiev@mongodb.com', 'username': 'kaloianm'}

Message: SERVER-43721 Make 'AuditEvent' explicitly list its includes
Branch: master
https://github.com/10gen/mongo-enterprise-modules/commit/72c69b40bc0d07766a68fa7f659842889397fd60

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