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

Use new node_names query param for voting exclusions as of 7.8.0 #3950

Merged
merged 2 commits into from
Nov 18, 2020

Conversation

pebrc
Copy link
Collaborator

@pebrc pebrc commented Nov 17, 2020

The new query parameter tolerates non-existing nodes and covers therefore the case where we try to remove a master node that has never successfully joined the cluster. This prevents an orchestration dead lock where the operator was previously unable to make progress due to an API error returned by Elasticsearch for nodes that were not part of the cluster.

Fixes #2951

The new query parameter tolerates non-existing nodes and covers therefore the case where we try to remove a master node that has never successfully joined the cluster. This prevents and orchestration dead lock where the operator was previously unable to make progress due to an API error returned by Elasticsearch.
@pebrc pebrc added >bug Something isn't working v1.3.1 labels Nov 17, 2020
Copy link
Contributor

@sebgl sebgl left a comment

Choose a reason for hiding this comment

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

LGTM

if c.version.IsSameOrAfter(version.From(7, 8, 0)) {
path = fmt.Sprintf("/_cluster/voting_config_exclusions?node_names=%s", strings.Join(nodeNames, ","))
} else {
path = fmt.Sprintf("/_cluster/voting_config_exclusions/%s", strings.Join(nodeNames, ","))
Copy link
Contributor

Choose a reason for hiding this comment

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

If c.version is empty (client constructed from client.NewElasticsearchClient()), we end up in this else path, which is fine.
Maybe worth explicitly pointing out in a comment though?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Not sure I follow your argument wrt to client.NewElasticsearchClient() but I added a comment.

Copy link
Contributor

Choose a reason for hiding this comment

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

I meant client which do not have a version set, which I think is the case when built from client.NewElasticsearchClient().
I'm 👍 with the comment.

if c.version.IsSameOrAfter(version.From(7, 8, 0)) {
path = fmt.Sprintf("/_cluster/voting_config_exclusions?node_names=%s", strings.Join(nodeNames, ","))
} else {
path = fmt.Sprintf("/_cluster/voting_config_exclusions/%s", strings.Join(nodeNames, ","))
Copy link
Contributor

Choose a reason for hiding this comment

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

I meant client which do not have a version set, which I think is the case when built from client.NewElasticsearchClient().
I'm 👍 with the comment.

@pebrc pebrc merged commit 46f147b into elastic:master Nov 18, 2020
pebrc added a commit to pebrc/cloud-on-k8s that referenced this pull request Nov 19, 2020
…stic#3950)

The new query parameter tolerates non-existing node names and covers therefore the case where we try to remove a master node that has never successfully joined the cluster. This prevents an orchestration deadlock where the operator was previously unable to make progress due to an API error returned by Elasticsearch.
pebrc added a commit that referenced this pull request Nov 24, 2020
…) (#3954)

The new query parameter tolerates non-existing node names and covers therefore the case where we try to remove a master node that has never successfully joined the cluster. This prevents an orchestration deadlock where the operator was previously unable to make progress due to an API error returned by Elasticsearch.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>bug Something isn't working v1.3.1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Set node names in the voting config exclusions API call starting 7.8.0
2 participants