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

ReshardingCoordinatorObserver should not fulfill promises if the "donors" or "recipients" fields are empty

    • Type: Icon: Task Task
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Sharding
    • None
    • Sharding NYC

      The following scenario causes the coordinator to invariant:
      1. Coordinator inserts the resharding coordinator document and is in the initializing state. The "donors" and "recipients" fields are empty.
      2. Coordinator failover/stepdown etc.
      3. New coordinator steps up, and rebuilds all primary only service instances.
      4. A ReshardingCoordinator instance is reconstructed, and is in initializing state. ReshardingCoordinatorObserver::onReshardingParticipantTransition is called.
      5. Every promise on the ReshardingCoordinator is fulfilled, because allParticipantsInStateGTE will return "true" when the participant list that is passed in is empty.
      6. ReshardingCoordinator run function begins, and the _awaitAllDonorsReadyToDonate promise will already be fulfilled. The ReshardingCoordinator will call getHighestMinFetchTimestamp() with the empty donors list, and then invariant.

      The coordinator should either not tell the ReshardingCoordinatorObserver to fulfill promises in it's constructor unless it's state is > initializing, or the ReshardingCoordinatorObserver should check whether the participants lists are empty and return that all participants are not in the desired state (or both).

      Repro:
      https://mongodbcr.appspot.com/820160487/

            Assignee:
            backlog-server-sharding-nyc [DO NOT USE] Backlog - Sharding NYC
            Reporter:
            janna.golden@mongodb.com Janna Golden
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: