-
Notifications
You must be signed in to change notification settings - Fork 25.1k
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
Run Node deprecation checks locally #38065
Conversation
At times, we need to check for usage of deprecated settings in settings which should not be returned by the NodeInfo API. This commit changes the deprecation info API to run all node checks locally so that these settings can be checked without exposing them via any externally accessible API.
Pinging @elastic/es-core-features |
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'm not super familiar with the deprecations infrastructure (but I will get more so), but I left some comments
|
||
@Override | ||
public int hashCode() { | ||
return Objects.hash(getClusterName(), getNodes()); |
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 needs to hash the failures also
|
||
import org.elasticsearch.test.AbstractStreamableTestCase; | ||
|
||
public class NodesDeprecationCheckRequestTests |
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 you add a mutateInstance
method to this so the hashcode is also tested?
import java.util.Collections; | ||
import java.util.List; | ||
|
||
public class NodesDeprecationCheckResponseTests |
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.
Same here about a mutateInstance
override
List<String> failedNodeIds = response.failures().stream() | ||
.map(failure -> failure.nodeId() + ": " + failure.getMessage()) | ||
.collect(Collectors.toList()); | ||
logger.error("Nodes failed to run deprecation checks: {}", failedNodeIds); |
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.
super minor nit, but generally we don't capitalize our log messages
I've completed the items indicated above so this is no longer a WIP, as well as addressing all of @dakrone's feedback above. |
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
At times, we need to check for usage of deprecated settings in settings which should not be returned by the NodeInfo API. This commit changes the deprecation info API to run all node checks locally so that these settings can be checked without exposing them via any externally accessible API.
At times, we need to check for usage of deprecated settings in settings which should not be returned by the NodeInfo API. This commit changes the deprecation info API to run all node checks locally so that these settings can be checked without exposing them via any externally accessible API.
At times, we need to check for usage of deprecated settings in settings
which should not be returned by the NodeInfo API. This commit changes
the deprecation info API to run all node checks locally so that these
settings can be checked without exposing them via any externally
accessible API.
Resolves #37845
This needs to go into both 6.x and master, but as this involves changes to many of the node deprecation checks that only exist in 6.x, my plan is to merge this initially to 6.x and forward-port to master.
This is marked as WIP because I still need to:
Settings
,PluginsAndModules
, etc. directly rather than a list of NodeInfo objectsnull
detail message better (currently shows up as"null (nodes impacted: [node-1, node-2])"
)