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

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

    • Fully Compatible
    • v5.0
    • Sharding 2021-08-09, Sharding 2021-08-23
    • 119
    • 1

      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:
            matt.walak@mongodb.com Matthew Walak (Inactive)
            Reporter:
            janna.golden@mongodb.com Janna Golden
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: