[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: |
|
||||
| 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. |