[SERVER-62855] MigrationDestinationManager should not blindly dereference _sessionMigration on recovery error handling Created: 21/Jan/22  Updated: 29/Oct/23  Resolved: 24/Jan/22

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

Type: Bug Priority: Major - P3
Reporter: Jordi Serra Torrens Assignee: Jordi Serra Torrens
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: Text File repro-server-62701.patch    
Issue Links:
Related
Backwards Compatibility: Fully Compatible
Operating System: ALL
Steps To Reproduce:

repro-server-62701.patch

Sprint: Sharding EMEA 2022-01-24
Participants:
Linked BF Score: 0

 Description   

If a new migration recipient primary steps-up and then fails (e.g. stepsdown too) during migration recovery, indeed _migrateThread will throw. On cleanup, it will dereference _sessionMigration, which if that node instance had never been the recipient of a migration, will be nullptr.
It is fine that _sessionMigration is nullptr on recovery. We should just not blindly dereference it in the error handling path.



 Comments   
Comment by Githook User [ 24/Jan/22 ]

Author:

{'name': 'Jordi Serra Torrens', 'email': 'jordi.serra-torrens@mongodb.com', 'username': 'jordist'}

Message: SERVER-62855 MigrationDestinationManager should not blindly dereference _sessionMigration on recovery error handling
Branch: master
https://github.com/mongodb/mongo/commit/76d9c93bbb80881f929b0c642bdcf20ceb1fc5a6

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