Skip to content
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

Merged
merged 12 commits into from
Feb 1, 2019

Conversation

gwbrown
Copy link
Contributor

@gwbrown gwbrown commented Jan 31, 2019

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:

  • Change the node deprecation check signature (and all of the checks themselves) to just take Settings, PluginsAndModules, etc. directly rather than a list of NodeInfo objects
  • Adjust the merging logic to handle a null detail message better (currently shows up as "null (nodes impacted: [node-1, node-2])")
  • Change all of the node deprecation check text to make a bit more sense with the adjusted format, or change how the list of nodes gets appended to the detail message

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.
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-features

Copy link
Member

@dakrone dakrone left a 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());
Copy link
Member

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
Copy link
Member

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
Copy link
Member

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);
Copy link
Member

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

@gwbrown gwbrown removed the WIP label Feb 1, 2019
@gwbrown
Copy link
Contributor Author

gwbrown commented Feb 1, 2019

I've completed the items indicated above so this is no longer a WIP, as well as addressing all of @dakrone's feedback above.

Copy link
Member

@dakrone dakrone left a comment

Choose a reason for hiding this comment

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

LGTM

@gwbrown gwbrown merged commit 0ee1272 into elastic:6.x Feb 1, 2019
gwbrown added a commit to gwbrown/elasticsearch that referenced this pull request Feb 2, 2019
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.
@jasontedor jasontedor removed the >bug label Feb 2, 2019
gwbrown added a commit that referenced this pull request Feb 4, 2019
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants