Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-51179

TenantMigrationDonorInstance should distinguish local and remote shutdown/stepdown errors

    XMLWordPrintable

    Details

    • Backwards Compatibility:
      Fully Compatible
    • Sprint:
      Sharding 2020-11-16, Sharding 2020-11-30, Sharding 2020-12-14

      Description

      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.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              jason.zhang Jason Zhang
              Reporter:
              esha.maharishi Esha Maharishi
              Participants:
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: