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

Deprecation check for : in Cluster/Index name #36185

Merged
merged 3 commits into from
Dec 4, 2018

Conversation

gwbrown
Copy link
Contributor

@gwbrown gwbrown commented Dec 3, 2018

Adds a deprecation check for cluster and index names that contain :,
which is illegal in 7.0.

Relates to #36024 and #26247

Adds a deprecation check for cluster and index names that contain `:`,
which is illegal in 7.0.
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-features

@@ -18,7 +18,7 @@ static DeprecationIssue checkShardLimit(ClusterState state) {
int maxShardsInCluster = shardsPerNode * nodeCount;
int currentOpenShards = state.getMetaData().getTotalOpenIndexShards();

if (currentOpenShards >= maxShardsInCluster) {
if (nodeCount != 0 && currentOpenShards >= maxShardsInCluster) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is a fix for bug that was revealed by the test for the new cluster-level deprecation check, but I sincerely doubt it would ever be hit in practice and I didn't think it was worth its own PR.

Copy link
Contributor

Choose a reason for hiding this comment

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

nit: IMO nodeCount > 0 && ... reads better, else i am asking myself how this value can ever be negative.

static DeprecationIssue indexNameCheck(IndexMetaData indexMetaData) {
String clusterName = indexMetaData.getIndex().getName();
if (clusterName.contains(":")) {
return new DeprecationIssue(DeprecationIssue.Level.CRITICAL,
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there guidance on what is Critical vs. Warning ?

Copy link
Contributor Author

@gwbrown gwbrown Dec 3, 2018

Choose a reason for hiding this comment

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

I believe Critical means "if you upgrade without fixing this your cluster will fail", whereas Warning means "you will get some deprecation warnings, and/or behavior probably won't be what you want".

This looks like it should be Critical for the cluster name but Warning for the index name - I'll fix that.

Copy link
Contributor

@jakelandis jakelandis left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@martijnvg martijnvg left a comment

Choose a reason for hiding this comment

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

LGTM

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