[SERVER-58782] ReshardingCoordinatorObserver should not fulfill promises if the "donors" or "recipients" fields are empty Created: 22/Jul/21  Updated: 06/Dec/22  Resolved: 22/Jul/21

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: None
Fix Version/s: None

Type: Task Priority: Major - P3
Reporter: Janna Golden Assignee: [DO NOT USE] Backlog - Sharding NYC
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
duplicates SERVER-58781 ReshardingCoordinatorObserver should ... Closed
Assigned Teams:
Sharding NYC
Participants:

 Description   

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/


Generated at Thu Feb 08 05:45:26 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.