Skip to content

Defer node environment construction#54919

Merged
jasontedor merged 1 commit intoelastic:masterfrom
jasontedor:defer-node-environment-construction
Apr 8, 2020
Merged

Defer node environment construction#54919
jasontedor merged 1 commit intoelastic:masterfrom
jasontedor:defer-node-environment-construction

Conversation

@jasontedor
Copy link
Copy Markdown
Member

Today we construct the node environment relatively early in the node construction process, before we have even constructed the final environment, which means before the final settings are available. Rather, we should defer constructing the node environment until the final environment is available. This commit does that. This helps delay node environment construction until after the node roles are properly determined, which is important since the node environment does some checks on the basis of whether or not the node is neither a data nor a master node (such nodes should not have index metadata nor shard data on disk). Note that a consequence of this is that the initial log line that displays the node name, node ID, and cluster name does not appear until later in startup (after we have loaded plugins). This seems okay.

Today we construct the node environment relatively early in the node
construction process, before we have even constructed the final
environment, which means before the final settings are
available. Rather, we should defer constructing the node environment
until the final environment is available. This commit does that. This
helps delay node environment construction until after the node roles are
properly determined, which is important since the node environment does
some checks on the basis of whether or not the node is neither a data
nor a master node (such nodes should not have index metadata nor shard
data on disk). Note that a consequence of this is that the initial log
line that displays the node name, node ID, and cluster name does not
appear until later in startup (after we have loaded plugins). This seems
okay.
@jasontedor jasontedor added :Core/Infra/Core Core issues without another label >refactoring v8.0.0 v7.8.0 labels Apr 7, 2020
@jasontedor jasontedor requested a review from rjernst April 7, 2020 19:21
@elasticmachine
Copy link
Copy Markdown
Collaborator

Pinging @elastic/es-core-infra (:Core/Infra/Core)

Copy link
Copy Markdown
Member

@rjernst rjernst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jasontedor jasontedor merged commit cc16df2 into elastic:master Apr 8, 2020
@jasontedor jasontedor deleted the defer-node-environment-construction branch April 8, 2020 13:23
jasontedor added a commit that referenced this pull request Apr 8, 2020
Today we construct the node environment relatively early in the node
construction process, before we have even constructed the final
environment, which means before the final settings are
available. Rather, we should defer constructing the node environment
until the final environment is available. This commit does that. This
helps delay node environment construction until after the node roles are
properly determined, which is important since the node environment does
some checks on the basis of whether or not the node is neither a data
nor a master node (such nodes should not have index metadata nor shard
data on disk). Note that a consequence of this is that the initial log
line that displays the node name, node ID, and cluster name does not
appear until later in startup (after we have loaded plugins). This seems
okay.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants