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 4108dab commit fb00992Copy full SHA for fb00992
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 votedNodesCount = 0;
+ for (String nodeId : nodeIds) {
+ if (votes.contains(nodeId)) {
352
+ votedNodesCount++;
353
+ }
354
355
+ return votedNodesCount * 2 > nodeIds.size();
356
357
358
public Set<String> getNodeIds() {
0 commit comments