Skip to content

Conversation

@jbaiera
Copy link
Member

@jbaiera jbaiera commented Mar 23, 2023

When submitting an enrich policy execution with wait_for_completion=false, the master node that services the request needs to wait on the remote task to complete so that it may unlock the policy for further runs. It currently does not set a timeout for the Get Task API call, which has a default timeout of 30 seconds. This is almost never enough time to cover an executing enrich policy. At the end of the timeout, the policy is unlocked without any further logic applied. This leaves the new enrich index that is under construction open to be deleted by the background maintenance task.

This PR is a quick fix for the problem. It ups the timeout on the get task API and adds additional logic in the event that the task await call fails.

fixes #94690

@jbaiera jbaiera added >bug :Data Management/Ingest Node Execution or management of Ingest Pipelines including GeoIP labels Mar 23, 2023
@elasticsearchmachine
Copy link
Collaborator

Hi @jbaiera, I've created a changelog YAML for you.

@jbaiera jbaiera marked this pull request as ready for review March 27, 2023 18:25
@elasticsearchmachine elasticsearchmachine added the Team:Data Management Meta label for data/management team label Mar 27, 2023
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-data-management (Team:Data Management)

Copy link
Member

@masseyke masseyke left a comment

Choose a reason for hiding this comment

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

LGTM

@jbaiera jbaiera merged commit f56fc01 into elastic:main Mar 28, 2023
@jbaiera jbaiera deleted the enrich-fix-master-task-await branch March 28, 2023 15:38
@elasticsearchmachine
Copy link
Collaborator

💔 Backport failed

Status Branch Result
8.7 Commit could not be cherrypicked due to conflicts

You can use sqren/backport to manually backport by running backport --upstream elastic/elasticsearch --pr 94702

@jbaiera
Copy link
Member Author

jbaiera commented Mar 28, 2023

This relates to #89835 and #85221 as it is likely the REAL fix for those bugs.

@jbaiera
Copy link
Member Author

jbaiera commented Mar 28, 2023

💚 All backports created successfully

Status Branch Result
8.7

Questions ?

Please refer to the Backport tool documentation

jbaiera added a commit to jbaiera/elasticsearch that referenced this pull request Mar 28, 2023
…lastic#94702) This PR ups the timeout on the EnrichExecutor's task API call and adds additional logic in the event that the task await call fails. Without this change, the task API call can timeout and unlock the policy prematurely. Premature unlocking can lead to the index being removed while the policy is executing. (cherry picked from commit f56fc01) # Conflicts: #	x-pack/plugin/enrich/src/main/java/org/elasticsearch/xpack/enrich/EnrichPolicyExecutor.java
jbaiera added a commit that referenced this pull request Mar 28, 2023
…94702) (#94837) This PR ups the timeout on the EnrichExecutor's task API call and adds additional logic in the event that the task await call fails. Without this change, the task API call can timeout and unlock the policy prematurely. Premature unlocking can lead to the index being removed while the policy is executing. (cherry picked from commit f56fc01)
@jbaiera
Copy link
Member Author

jbaiera commented Mar 28, 2023

💚 All backports created successfully

Status Branch Result
7.17

Questions ?

Please refer to the Backport tool documentation

jbaiera added a commit to jbaiera/elasticsearch that referenced this pull request Mar 28, 2023
…lastic#94702) This PR ups the timeout on the EnrichExecutor's task API call and adds additional logic in the event that the task await call fails. Without this change, the task API call can timeout and unlock the policy prematurely. Premature unlocking can lead to the index being removed while the policy is executing. (cherry picked from commit f56fc01) # Conflicts: #	x-pack/plugin/enrich/src/main/java/org/elasticsearch/xpack/enrich/EnrichPolicyExecutor.java #	x-pack/plugin/enrich/src/test/java/org/elasticsearch/xpack/enrich/EnrichPolicyExecutorTests.java
jbaiera added a commit that referenced this pull request Mar 28, 2023
…94702) (#94841) This PR ups the timeout on the EnrichExecutor's task API call and adds additional logic in the event that the task await call fails. Without this change, the task API call can timeout and unlock the policy prematurely. Premature unlocking can lead to the index being removed while the policy is executing. (cherry picked from commit f56fc01) # Conflicts: #	x-pack/plugin/enrich/src/main/java/org/elasticsearch/xpack/enrich/EnrichPolicyExecutor.java #	x-pack/plugin/enrich/src/test/java/org/elasticsearch/xpack/enrich/EnrichPolicyExecutorTests.java
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.17.10 v8.7.1 v8.8.0

3 participants