diff --git a/core/src/main/java/org/elasticsearch/discovery/zen/ElectMasterService.java b/core/src/main/java/org/elasticsearch/discovery/zen/ElectMasterService.java index 92b20c5199b..024c50fb6e0 100644 --- a/core/src/main/java/org/elasticsearch/discovery/zen/ElectMasterService.java +++ b/core/src/main/java/org/elasticsearch/discovery/zen/ElectMasterService.java @@ -150,7 +150,8 @@ public class ElectMasterService extends AbstractComponent { } public boolean hasEnoughMasterNodes(Iterable nodes) { - return minimumMasterNodes < 1 || countMasterNodes(nodes) >= minimumMasterNodes; + final int count = countMasterNodes(nodes); + return count > 0 && (minimumMasterNodes < 0 || count >= minimumMasterNodes); } public boolean hasTooManyMasterNodes(Iterable nodes) {