ElectMasterService.hasEnoughMasterNodes should return false if no masters were found
This is a regression introduced in #20063
This commit is contained in:
parent
e81bbc288a
commit
8758c541b3
|
@ -150,7 +150,8 @@ public class ElectMasterService extends AbstractComponent {
|
|||
}
|
||||
|
||||
public boolean hasEnoughMasterNodes(Iterable<DiscoveryNode> nodes) {
|
||||
return minimumMasterNodes < 1 || countMasterNodes(nodes) >= minimumMasterNodes;
|
||||
final int count = countMasterNodes(nodes);
|
||||
return count > 0 && (minimumMasterNodes < 0 || count >= minimumMasterNodes);
|
||||
}
|
||||
|
||||
public boolean hasTooManyMasterNodes(Iterable<DiscoveryNode> nodes) {
|
||||
|
|
Loading…
Reference in New Issue