Log [initial_master_nodes] on formation failure (#36466)
Today we log a slightly cryptic "cluster bootstrapping is disabled on this node" message if bootstrapping hasn't been configured. Since there is today only one way to bootstrap the cluster it seems preferable to spell out exactly which setting is missing.
This commit is contained in:
parent
00eadd93eb
commit
c3a6d1998a
|
@ -150,7 +150,7 @@ public class ClusterFormationFailureHelper {
|
|||
|
||||
if (INITIAL_MASTER_NODE_COUNT_SETTING.get(Settings.EMPTY).equals(INITIAL_MASTER_NODE_COUNT_SETTING.get(settings))
|
||||
&& INITIAL_MASTER_NODES_SETTING.get(Settings.EMPTY).equals(INITIAL_MASTER_NODES_SETTING.get(settings))) {
|
||||
bootstrappingDescription = "cluster bootstrapping is disabled on this node";
|
||||
bootstrappingDescription = "[" + INITIAL_MASTER_NODES_SETTING.getKey() + "] is empty on this node";
|
||||
} else if (INITIAL_MASTER_NODES_SETTING.get(Settings.EMPTY).equals(INITIAL_MASTER_NODES_SETTING.get(settings))) {
|
||||
bootstrappingDescription = String.format(Locale.ROOT,
|
||||
"this node must discover at least [%d] master-eligible nodes to bootstrap a cluster",
|
||||
|
|
|
@ -156,20 +156,20 @@ public class ClusterFormationFailureHelperTests extends ESTestCase {
|
|||
|
||||
assertThat(new ClusterFormationState(Settings.EMPTY, clusterState, emptyList(), emptyList()).getDescription(),
|
||||
is("master not discovered yet, this node has not previously joined a bootstrapped (v7+) cluster, and " +
|
||||
"cluster bootstrapping is disabled on this node: have discovered []; " +
|
||||
"[cluster.initial_master_nodes] is empty on this node: have discovered []; " +
|
||||
"discovery will continue using [] from hosts providers and [" + localNode + "] from last-known cluster state"));
|
||||
|
||||
final TransportAddress otherAddress = buildNewFakeTransportAddress();
|
||||
assertThat(new ClusterFormationState(Settings.EMPTY, clusterState, singletonList(otherAddress), emptyList()).getDescription(),
|
||||
is("master not discovered yet, this node has not previously joined a bootstrapped (v7+) cluster, and " +
|
||||
"cluster bootstrapping is disabled on this node: have discovered []; " +
|
||||
"[cluster.initial_master_nodes] is empty on this node: have discovered []; " +
|
||||
"discovery will continue using [" + otherAddress + "] from hosts providers and [" + localNode +
|
||||
"] from last-known cluster state"));
|
||||
|
||||
final DiscoveryNode otherNode = new DiscoveryNode("other", buildNewFakeTransportAddress(), Version.CURRENT);
|
||||
assertThat(new ClusterFormationState(Settings.EMPTY, clusterState, emptyList(), singletonList(otherNode)).getDescription(),
|
||||
is("master not discovered yet, this node has not previously joined a bootstrapped (v7+) cluster, and " +
|
||||
"cluster bootstrapping is disabled on this node: have discovered [" + otherNode + "]; " +
|
||||
"[cluster.initial_master_nodes] is empty on this node: have discovered [" + otherNode + "]; " +
|
||||
"discovery will continue using [] from hosts providers and [" + localNode + "] from last-known cluster state"));
|
||||
|
||||
assertThat(new ClusterFormationState(Settings.builder().put(INITIAL_MASTER_NODE_COUNT_SETTING.getKey(), 2).build(),
|
||||
|
|
Loading…
Reference in New Issue