[SERVER-82324] Fix data race when reading/writing the logical session id Created: 19/Oct/23  Updated: 30/Oct/23  Resolved: 23/Oct/23

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 7.1.1, 7.2.0-rc0, 7.0.4

Type: Bug Priority: Major - P3
Reporter: Pol Pinol Assignee: Pol Pinol
Resolution: Fixed Votes: 0
Labels: None
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:
v7.1, v7.0
Sprint: Sharding EMEA 2023-10-30
Participants:
Linked BF Score: 119

 Description   

The thread in kill_sessions_common.cpp acquires the client lock and reads the logical session id on opCtx, while the thread in sharding_ddl_util.cpp sets a new logical session id without the client lock.

Consequently, we could end up with a data race at the logical session id from the opCtx.

A possible solution could be to protect this write with the client lock.



 Comments   
Comment by Githook User [ 30/Oct/23 ]

Author:

{'name': 'Pol Pinol Castuera', 'email': 'pol.pinol@mongodb.com', 'username': 'PolPinol'}

Message: SERVER-82324 Fix data race when reading/writing the logical session id

(cherry picked from commit 2911056b7f0e849fc1f5ba7e816744bb54654398)
Branch: v7.0
https://github.com/mongodb/mongo/commit/5c2fe36e01a437ac365b1ad00f0f4cfffbb94d43

Comment by Githook User [ 24/Oct/23 ]

Author:

{'name': 'Pol Pinol Castuera', 'email': 'pol.pinol@mongodb.com', 'username': 'PolPinol'}

Message: SERVER-82324 Fix data race when reading/writing the logical session id

(cherry picked from commit 2911056b7f0e849fc1f5ba7e816744bb54654398)
Branch: v7.1
https://github.com/mongodb/mongo/commit/7258a517fd1761a8ad416fc82aa2817cff544532

Comment by Githook User [ 23/Oct/23 ]

Author:

{'name': 'Pol Pinol Castuera', 'email': 'pol.pinol@mongodb.com', 'username': 'PolPinol'}

Message: SERVER-82324 Fix data race when reading/writing the logical session id
Branch: master
https://github.com/mongodb/mongo/commit/2911056b7f0e849fc1f5ba7e816744bb54654398

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