[SERVER-35047] Remove globalInShutdownDeprecated from the condition to cleanly terminate migrations Created: 17/May/18  Updated: 27/Oct/23  Resolved: 25/May/18

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

Type: Bug Priority: Major - P3
Reporter: Randolph Tan Assignee: [DO NOT USE] Backlog - Sharding Team
Resolution: Works as Designed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
Assigned Teams:
Sharding
Operating System: ALL
Participants:
Linked BF Score: 0

 Description   

Note that the condition here:

https://github.com/mongodb/mongo/blob/r3.7.9/src/mongo/db/s/migration_source_manager.cpp#L483

Checks for the shutdown status and calls inShutdown(). Because inShutdown is using memory_order_relaxed, it is totally legal for another thread to be in "shutdown" state and return a shutdown error, while the migration thread still sees that it is not yet in "shutdown".



 Comments   
Comment by Kaloian Manassiev [ 25/May/18 ]

This usage of globalInShutdownDeprecated was added as part of this commit in order to ensure that mongod won't crash if it happened to shutdown right when it was committing a migration. Because of this, we cannot remove it.

Generated at Thu Feb 08 04:38:40 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.