assert inSyncAllocationIds.isEmpty() == false; nodeShardsResult = buildAllocationIdBasedNodeShardsResult(unassignedShard, snapshotRestore || recoverOnAnyNode, allocation.getIgnoreNodes(unassignedShard.shardId()), inSyncAllocationIds, shardState, logger); enoughAllocationsFound = nodeShardsResult.orderedAllocationCandidates.size() > 0;