We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d8ba3a3 commit 155a1f2Copy full SHA for 155a1f2
server/src/main/java/org/elasticsearch/cluster/coordination/CoordinationMetadata.java
@@ -346,9 +346,13 @@ public void writeTo(StreamOutput out) throws IOException {
346
}
347
348
public boolean hasQuorum(Collection<String> votes) {
349
- final HashSet<String> intersection = new HashSet<>(nodeIds);
350
- intersection.retainAll(votes);
351
- return intersection.size() * 2 > nodeIds.size();
+ int votedNodes = 0;
+ for (String nodeId : nodeIds) {
+ if (votes.contains(nodeId)) {
352
+ votedNodes++;
353
+ }
354
355
+ return votedNodes * 2 > nodeIds.size();
356
357
358
public Set<String> getNodeIds() {
0 commit comments