-
Notifications
You must be signed in to change notification settings - Fork 25.2k
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
Remove node.max_local_storage_nodes #42428
Conversation
Pinging @elastic/es-core-infra |
There was a problem hiding this 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];" + |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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)); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 thecatch
clause nodeLock
can becomefinal
and move inside the outertry
.- Do we still need to special-case
LockObtainFailedException
? Seems ok to me to include the stack trace for allIOExceptions
.
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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()) { |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed in 096e713
There was a problem hiding this 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.
Allows this setting to be removed in 8.0, see #42428
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
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