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

Execute EnrichPolicyRunner on a non dedicated master node. #76881

Conversation

martijnvg
Copy link
Member

In case a cluster consists out of multiple nodes then delegate the execution of EnrichPolicyRunner
to a node that is not the elected master and nodes that are not dedicated master.

Closes #70436

@martijnvg martijnvg force-pushed the enrich_delegate_policy_runner_to_non_dedicated_master_node branch 2 times, most recently from 9b45d01 to dd73f02 Compare August 25, 2021 10:06
Introduce an internal action that the execute policy action delegates to.
This to ensure that the actual policy execution is never executed on the elected master node
or dedicated master nodes. In case the cluster consists out of a single node then
the internal action will attempt to execute on the current/local node.

The actual enrich policy execution is encapsulated in the `EnrichPolicyRunner` class.
This class manages the execution of several API calls, so this itself isn't doing anything heavy.
However the coordination of these api calls (in particular the reindex api call) may involve
some non-neglectable work/overhead and this shouldn't be performed on the elected master
or any other dedicated master node.

Closes elastic#70436
@martijnvg martijnvg force-pushed the enrich_delegate_policy_runner_to_non_dedicated_master_node branch from dd73f02 to 5d7a948 Compare August 25, 2021 11:38
@martijnvg martijnvg marked this pull request as ready for review August 25, 2021 11:39
@martijnvg martijnvg added :Data Management/Ingest Node Execution or management of Ingest Pipelines including GeoIP >bug v7.16.0 v8.0.0-alpha1 labels Aug 25, 2021
@elasticmachine elasticmachine added the Team:Data Management Meta label for data/management team label Aug 25, 2021
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-features (Team:Core/Features)

Copy link
Contributor

@danhermann danhermann left a comment

Choose a reason for hiding this comment

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

General structure and test coverage LGTM. I'm less familiar with the nitty-gritty of tasks but would be interested in more info on that at some point.

Co-authored-by: Dan Hermann <danhermann@users.noreply.github.com>
Copy link
Member

@jbaiera jbaiera left a comment

Choose a reason for hiding this comment

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

Some questions regarding order of locking/unlocking policies. I like the idea here, but I think the policy locking/unlocking is tricky, especially with waitForComplete=false

… response but not release the policy immediately.

Execute get task request with wait_for_completion=true and when that returns release the policy.
@martijnvg martijnvg added v7.15.0 and removed v7.16.0 labels Sep 1, 2021
Copy link
Member

@jbaiera jbaiera left a comment

Choose a reason for hiding this comment

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

Thanks @martijnvg, LGTM!

@martijnvg martijnvg removed the v8.0.0 label Sep 2, 2021
@martijnvg martijnvg merged commit b24a057 into elastic:master Sep 2, 2021
martijnvg added a commit to martijnvg/elasticsearch that referenced this pull request Sep 2, 2021
Backporting elastic#76881 to 7.x branch.

Introduce an internal action that the execute policy action delegates to.
This to ensure that the actual policy execution is never executed on the elected master node
or dedicated master nodes. In case the cluster consists out of a single node then
the internal action will attempt to execute on the current/local node.

The actual enrich policy execution is encapsulated in the `EnrichPolicyRunner` class.
This class manages the execution of several API calls, so this itself isn't doing anything heavy.
However the coordination of these api calls (in particular the reindex api call) may involve
some non-neglectable work/overhead and this shouldn't be performed on the elected master
or any other dedicated master node.

Closes elastic#70436
martijnvg added a commit to martijnvg/elasticsearch that referenced this pull request Sep 2, 2021
Backporting elastic#76881 to 7.x branch.

Introduce an internal action that the execute policy action delegates to.
This to ensure that the actual policy execution is never executed on the elected master node
or dedicated master nodes. In case the cluster consists out of a single node then
the internal action will attempt to execute on the current/local node.

The actual enrich policy execution is encapsulated in the `EnrichPolicyRunner` class.
This class manages the execution of several API calls, so this itself isn't doing anything heavy.
However the coordination of these api calls (in particular the reindex api call) may involve
some non-neglectable work/overhead and this shouldn't be performed on the elected master
or any other dedicated master node.

Closes elastic#70436
martijnvg added a commit to martijnvg/elasticsearch that referenced this pull request Sep 2, 2021
Backporting elastic#76881 to 7.15 branch.

Introduce an internal action that the execute policy action delegates to.
This to ensure that the actual policy execution is never executed on the elected master node
or dedicated master nodes. In case the cluster consists out of a single node then
the internal action will attempt to execute on the current/local node.

The actual enrich policy execution is encapsulated in the `EnrichPolicyRunner` class.
This class manages the execution of several API calls, so this itself isn't doing anything heavy.
However the coordination of these api calls (in particular the reindex api call) may involve
some non-neglectable work/overhead and this shouldn't be performed on the elected master
or any other dedicated master node.

Closes elastic#70436
martijnvg added a commit to martijnvg/elasticsearch that referenced this pull request Sep 2, 2021
martijnvg added a commit that referenced this pull request Sep 2, 2021
Backporting #76881 to 7.15 branch.

Introduce an internal action that the execute policy action delegates to.
This to ensure that the actual policy execution is never executed on the elected master node
or dedicated master nodes. In case the cluster consists out of a single node then
the internal action will attempt to execute on the current/local node.

The actual enrich policy execution is encapsulated in the `EnrichPolicyRunner` class.
This class manages the execution of several API calls, so this itself isn't doing anything heavy.
However the coordination of these api calls (in particular the reindex api call) may involve
some non-neglectable work/overhead and this shouldn't be performed on the elected master
or any other dedicated master node.

Closes #70436
martijnvg added a commit that referenced this pull request Sep 2, 2021
Backporting #76881 to 7.x branch.

Introduce an internal action that the execute policy action delegates to.
This to ensure that the actual policy execution is never executed on the elected master node
or dedicated master nodes. In case the cluster consists out of a single node then
the internal action will attempt to execute on the current/local node.

The actual enrich policy execution is encapsulated in the `EnrichPolicyRunner` class.
This class manages the execution of several API calls, so this itself isn't doing anything heavy.
However the coordination of these api calls (in particular the reindex api call) may involve
some non-neglectable work/overhead and this shouldn't be performed on the elected master
or any other dedicated master node.

Closes #70436
martijnvg added a commit that referenced this pull request Sep 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>bug :Data Management/Ingest Node Execution or management of Ingest Pipelines including GeoIP Team:Data Management Meta label for data/management team v7.15.0 v8.0.0-alpha2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enrich policy execution can be a heavy burden on the master
6 participants