From 9cc416bc4611d52ce11297b94a46053fa38df5eb Mon Sep 17 00:00:00 2001 From: David Turner Date: Sat, 1 Dec 2018 07:20:19 +0000 Subject: [PATCH] Weaken assertion in PeerFinder It can be inactive with no leader if it's handling an incoming PeersRequest before being activated for the first time. --- .../src/main/java/org/elasticsearch/discovery/PeerFinder.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/src/main/java/org/elasticsearch/discovery/PeerFinder.java b/server/src/main/java/org/elasticsearch/discovery/PeerFinder.java index 92483167bb7..da8e36b796f 100644 --- a/server/src/main/java/org/elasticsearch/discovery/PeerFinder.java +++ b/server/src/main/java/org/elasticsearch/discovery/PeerFinder.java @@ -161,7 +161,7 @@ public abstract class PeerFinder { peersRequest.getKnownPeers().stream().map(DiscoveryNode::getAddress).forEach(this::startProbe); knownPeers = getFoundPeersUnderLock(); } else { - assert leader.isPresent(); + assert leader.isPresent() || lastAcceptedNodes == null; knownPeers = Collections.emptyList(); } return new PeersResponse(leader, knownPeers, currentTerm);