Skip to content

Remove node.max_local_storage_nodes #42428

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
May 23, 2019

Conversation

ywelsch
Copy link
Contributor

@ywelsch ywelsch commented May 23, 2019

This setting, which prior to Elasticsearch 5 was enabled by default and caused all kinds of confusion, has since been disabled by default and is not recommended for production use. The prefered way going forward is for users to explicitly specify separate data folders for each started node to ensure that each node is consistently assigned to the same data path.

A follow-up will move the default data path from ${data.paths}/nodes/0 to ${data.paths}

Relates to #42426

@ywelsch ywelsch requested a review from DaveCTurner May 23, 2019 08:16
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-infra

Copy link
Contributor

@DaveCTurner DaveCTurner left a comment

Choose a reason for hiding this comment

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

So much nicer.

I asked for a bit more tidy-up and spotted some more docs that need adjusting.

MAX_LOCAL_STORAGE_NODES_SETTING.getKey(),
maxLocalStorageNodes);
throw new IllegalStateException(message, lastException);
"failed to obtain node locks, tried [%s] with lock id [0];" +
Copy link
Contributor

Choose a reason for hiding this comment

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

Given that we're changing the tail of this message, we may as well drop the lock id [0] bit too.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed in 096e713

Settings.builder().put(NodeEnvironment.MAX_LOCAL_STORAGE_NODES_SETTING.getKey(), value).build());
assertEquals(value, max);
}

public void testNodeLockSingleEnvironment() throws IOException {
Copy link
Contributor

Choose a reason for hiding this comment

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

Don't really need the SingleEnvironment bit of the name any more

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed in 096e713

throws Exception {
final MockTerminal terminal = new MockTerminal();
final OptionSet options = command.getParser().parse("-ordinal", Integer.toString(nodeOrdinal));
Copy link
Contributor

Choose a reason for hiding this comment

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

This option is documented in docs/reference/commands/node-tool.asciidoc, so those docs need adjusting too.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed in 68e43e3

return true;
});
} catch (LockObtainFailedException e) {
// ignore any LockObtainFailedException
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we can tidy this up a bit more now that there's no retry loop:

  • no need to capture exception in a local variable, it can be thrown from the catch clause
  • nodeLock can become final and move inside the outer try.
  • Do we still need to special-case LockObtainFailedException? Seems ok to me to include the stack trace for all IOExceptions.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed in 096e713

try {
nodeLock = new NodeLock(logger, environment,
dir -> {
Files.createDirectories(dir);
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we create the directories first, and then this argument can become p -> true? Arguably we could replace it with p -> true everywhere and therefore drop it entirely.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Arguably we could replace it with p -> true everywhere and therefore drop it entirely

not quite. For the node tools, we just select the directories that exist (i.e. possibly a subset). Here, we want to enforce that they all exist.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think it'd be ok for the node tools to fail if path.data points to paths that don't exist, rather than skipping over them as they do today. You can always adjust path.data to get the tool to run.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll mull over this, and open a follow-up PR

}
this.locks = nodeLock.locks;
this.nodePaths = nodeLock.nodePaths;
this.nodeLockId = nodeLock.nodeId;
this.nodeMetaData = loadOrCreateNodeMetaData(settings, logger, nodePaths);

if (logger.isDebugEnabled()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this guard is unnecessary.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed in 096e713

@ywelsch ywelsch requested a review from DaveCTurner May 23, 2019 09:30
Copy link
Contributor

@DaveCTurner DaveCTurner left a comment

Choose a reason for hiding this comment

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

LGTM. I commented about the predicate passed to the constructor of NodeLock but it's ok as-is and/or we can follow up separately with this change.

ywelsch added a commit that referenced this pull request May 23, 2019
Allows this setting to be removed in 8.0, see #42428
@ywelsch ywelsch merged commit c459ea8 into elastic:master May 23, 2019
gurkankaymak pushed a commit to gurkankaymak/elasticsearch that referenced this pull request May 27, 2019
This setting, which prior to Elasticsearch 5 was enabled by default and caused all kinds of
confusion, has since been disabled by default and is not recommended for production use. The
preferred way going forward is for users to explicitly specify separate data folders for each started
node to ensure that each node is consistently assigned to the same data path.

Relates to elastic#42426
masseyke added a commit that referenced this pull request Sep 2, 2021
The "node.max_local_storage_nodes" property has been removed in 8.0. This commit adds a deprecation
info API check for the property.
Relates #42404 #42428
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>breaking :Core/Infra/Core Core issues without another label v8.0.0-alpha1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants