-
Type: Task
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: Replication
-
Fully Compatible
-
Sharding 2020-11-16, Sharding 2020-11-30, Sharding 2020-12-14
Currently, TenantMigrationDonorInstance stops retrying on shutdown/stepdown errors regardless of if the error is local or remote.
Once there is a way to distinguish local and remote errors, TenantMigrationDonorInstance should be updated to only stop retrying if the error is local.
Edit: We decided not to use the machinery being built for SERVER-50549. Instead, we can use the fact that an Instance has a private _isRunning bool that gets set to true when the instance's run() is called.
Right now the bool never gets set to false, but we can make PrimaryOnlyService::onStepdown and PrimaryOnlyService::shutdown iterate all instances in that service and set their _isRunning bools to false, similarly to how they iterate their instances and call interrupt on them. (This does mean PrimaryOnlyService::Instance will need a member mutex to protect _isRunning.)
We can add a protected `const isRunning()` method to PrimaryOnlyService::Instance that returns _isRunning.
Then, an instance's retry loop can just keep retrying until `status.isOK() || !isRunning()` instead of checking if the status is a NotPrimary or Shutdown error.
- depends on
-
SERVER-50549 Transform connection-related error codes in proxied commands
- Closed
- is related to
-
SERVER-51012 Integrate CancelationTokens with PrimaryOnlyService
- Closed