[SERVER-83914] Ensure safe SessionCatalog initialization and use in embedded router mode Created: 05/Dec/23  Updated: 23/Jan/24  Resolved: 23/Jan/24

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

Type: Task Priority: Major - P3
Reporter: George Wangensteen Assignee: Pol Pinol
Resolution: Works as Designed Votes: 0
Labels: pm-635-milestone-1
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Assigned Teams:
Service Arch
Sprint: CAR Team 2024-01-08, CAR Team 2024-01-22, CAR Team 2024-02-05
Participants:

 Description   

We need to ensure and document the access-pattern and types that will be used to represent the SessionCatalog when mongod is running in embedded router mode. I think it is safe to only have one in-memory SessionCatalog, and re-use the existing MongodSessionCatalog. We will just need to ensure that the reaping functionality in the RouterSessionCatalog here: https://github.com/mongodb/mongo/blob/a37dd902790b062a41fa87aacf57adce8ba503e6/src/mongo/s/session_catalog_router.cpp#L45 is preserved, that all Router operations use RouterOperationContextSession, and that yielding is performed when needed to ensure we don't deadlock trying to check out a session we already are using.

This ticket tracks whatever code changes are necessary to initialize and use the SessionCatalog correctly in embedded router mode, as well as documenting the decision and explaining it in the arch guide or elsewhere.



 Comments   
Comment by Pol Pinol [ 23/Jan/24 ]

This ticket can be closed as Works as Designed because there is no work to do in for the SessionCatalog in an embedded router world.

  • SessionCatalog is an API that is shared both by the shard and router.
  • Then, we have the MongoDSessionCatalog only used by the shard. It is important to note that it is not an implementation of the SessionCatalog for the mongod, it is only an extension of the API that still uses the former SessionCatalog.
  • And last, the RouterSessionCatalog. This only owns the implementation for 'reapSessionsOlderThan', that we already combined in the LogicalSessionCache

The only "remaining" work is to properly handle 'reapSessionolderThan', that it is included in SERVER-83915 scope.

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