[SERVER-48689] MigrationDestinationManager waits for thread to join with session checked out Created: 10/Jun/20  Updated: 29/Oct/23  Resolved: 16/Jul/20

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: None
Fix Version/s: 4.4.1, 4.7.0

Type: Bug Priority: Major - P3
Reporter: Tess Avitabile (Inactive) Assignee: Jack Mulrow
Resolution: Fixed Votes: 0
Labels: KP44
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Depends
is depended on by SERVER-47645 Must invalidate all sessions on step ... Closed
Related
related to SERVER-48641 Deadlock due to the MigrationDestinat... Closed
related to SERVER-73106 [v4.4] Chunk migration attempts to wa... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v4.4
Sprint: Sharding 2020-07-13, Sharding 2020-07-27
Participants:
Case:
Linked BF Score: 33

 Description   

The MigrationDestinationManager waits for a thread to join here while holding a session checked out. This thread can do blocking work, such as checking out a different session. This can lead to a deadlock with a thread that is checking out all of the sessions for kill:

(1) MigrationDestinationManager checks out session A.
(2) Killing thread marks all sessions as killed.
(3) Killing thread waits to check out session A for kill.
(4) _thread waits to check out session B, but is blocked because session B is marked as killed.
(5) MigrationDestinationManager waits for _thread to join.



 Comments   
Comment by Githook User [ 12/Aug/20 ]

Author:

{'name': 'Jack Mulrow', 'email': 'jack.mulrow@mongodb.com', 'username': 'jsmulrow'}

Message: SERVER-48641 SERVER-48689 Yield session in migration destination driver when waiting on replication and session migration

(cherry picked from commit 21b083c7352704fc8c3d8a4f33c54040259ff766)
Branch: v4.4
https://github.com/mongodb/mongo/commit/91f3ad01c5fe5599d9ba679a659745fa3b7eb00b

Comment by Tess Avitabile (Inactive) [ 27/Jul/20 ]

Does this affect 4.2? We need to backport SERVER-47645 to 4.2.

Comment by Githook User [ 16/Jul/20 ]

Author:

{'name': 'Jack Mulrow', 'email': 'jack.mulrow@mongodb.com', 'username': 'jsmulrow'}

Message: SERVER-48641 SERVER-48689 Yield session in migration destination driver when waiting on replication and session migration
Branch: master
https://github.com/mongodb/mongo/commit/21b083c7352704fc8c3d8a4f33c54040259ff766

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