[SERVER-61812] list_local_sessions.js can fail if $listLocalSessions occurs during a cache refresh Created: 30/Nov/21  Updated: 29/Oct/23  Resolved: 16/Jun/22

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 6.0.0-rc11, 6.1.0-rc0

Type: Bug Priority: Major - P3
Reporter: Brett Nawrocki Assignee: Nandini Bhartiya
Resolution: Fixed Votes: 0
Labels: sharding-nyc-subteam1, sharding-wfbf-day
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Depends
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v6.0
Steps To Reproduce:

Create a failpoint to pause after releasing the lock when swapping during LogicalSessionCacheImpl::_refresh() and wait for it to be entered before calling $listLocalSessions in the test.

Sprint: Sharding NYC 2022-06-13, Sharding 2022-06-27
Participants:
Linked BF Score: 15
Story Points: 2

 Description   

list_local_sessions.js will create a session and then will use $listLocalSessions to retrieve all sessions and the current user's sessions and verify that the created session is present.

The logical session cache will return these sessions from its _activeSessions. However, during a cache refresh (which happens periodically), these sessions will be temporarily swapped out until the backswapper goes out of scope. It is therefore possible for the $listLocalSessions command to fail to return the created session if the request is processed during this period of time when _activeSessions has been swapped.



 Comments   
Comment by Githook User [ 17/Jun/22 ]

Author:

{'name': 'nandinibhartiyaMDB', 'email': 'nandini.bhartiya@mongodb.com', 'username': 'nandinibhartiyaMDB'}

Message: SERVER-61812: Ensure cache is not refreshed during $listLocalSessions
Branch: v6.0
https://github.com/mongodb/mongo/commit/53db7af5a8e2f59a63ca77f78a0c70099c53b603

Comment by Githook User [ 16/Jun/22 ]

Author:

{'name': 'nandinibhartiyaMDB', 'email': 'nandini.bhartiya@mongodb.com', 'username': 'nandinibhartiyaMDB'}

Message: SERVER-61812: Ensure cache is not refreshed during $listLocalSessions
Branch: master
https://github.com/mongodb/mongo/commit/8f0a435d75de0a503104ff984362180018a7f663

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