Make PrimaryOnlyService::shutdown explicitly interrupt tracked OperationContexts

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Fixed
    • Priority: Major - P3
    • 4.9.0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Fully Compatible
    • ALL
    • Service arch 2020-12-28, Sharding 2021-02-22
    • 1
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      SERVER-51095 made PrimaryOnlyService::stepdown explicitly interrupt tracked OperationContexts, because a PrimaryOnlyService instance could create a new OperationContext in the window between when the stepdown thread kills OperationContexts and calls PrimaryOnlyService::stepdown via updateMemberState.

      On shutdown:

      First ReplicationCoordinator::stepdown is called.

      Then ReplicationCoordinator::shutdown is called, which calls PrimaryOnlyService::shutdown, which joins all running instances.

      Finally, all OperationContexts are marked as killed.

      However, the first step ReplicationCoordinator::stepdown is allowed to fail. In that case, PrimaryOnlyService::shutdown may try to join a running instance whose OperationContext has not been interrupted.

      To avoid this, PrimaryOnlyService::shutdown should also explicitly interrupt all its OperationContexts.

              Assignee:
              Blake Oler
              Reporter:
              Esha Maharishi (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: