Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fully initialize cluster state on ephemeral nodes (#71466)
Today ephemeral nodes (i.e. those that aren't master-eligible and don't contain data) have an initial "persisted" state which is very empty. In particular it doesn't contain any cluster blocks or even the local node. This violates some assumptions elsewhere that the local node is always included in the cluster state, and breaks things like the `ClusterFormationFailureHelper`: [DEBUG][o.e.c.c.ClusterFormationFailureHelper] unexpected exception scheduling cluster formation warning java.lang.NullPointerException: Cannot invoke "org.elasticsearch.cluster.node.DiscoveryNode.isMasterNode()" because the return value of "org.elasticsearch.cluster.node.DiscoveryNodes.getLocalNode()" is null at org.elasticsearch.cluster.coordination.ClusterFormationFailureHelper$ClusterFormationState.getDescription(ClusterFormationFailureHelper.java:147) ~[elasticsearch-7.11.0.jar:7.11.0] at org.elasticsearch.cluster.coordination.ClusterFormationFailureHelper$WarningScheduler$1.doRun(ClusterFormationFailureHelper.java:92) [elasticsearch-7.11.0.jar:7.11.0] at org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingAbstractRunnable.doRun(ThreadContext.java:732) [elasticsearch-7.11.0.jar:7.11.0] at org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:26) [elasticsearch-7.11.0.jar:7.11.0] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130) [?:?] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630) [?:?] at java.lang.Thread.run(Thread.java:832) [?:?] This commit addresses this by initializing the persisted state properly.
- Loading branch information