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

[7.x][ML] Fix race condition updating reindexing progress (#56135) #56146

Conversation

dimitris-athanasiou
Copy link
Contributor

In #55763 I thought I could remove the flag that marks
reindexing was finished on a data frame analytics task.
However, that exposed a race condition. It is possible that
between updating reindexing progress to 100 because we
have called DataFrameAnalyticsManager.startAnalytics() and
a call to the _stats API which updates reindexing progress via the
method DataFrameAnalyticsTask.updateReindexTaskProgress() we
end up overwriting the 100 with a lower progress value.

This commit fixes this issue by bringing back the help of
a isReindexingFinished flag as it was prior to #55763.

Closes #56128

Backport of #56135

)

In elastic#55763 I thought I could remove the flag that marks
reindexing was finished on a data frame analytics task.
However, that exposed a race condition. It is possible that
between updating reindexing progress to 100 because we
have called `DataFrameAnalyticsManager.startAnalytics()` and
a call to the _stats API which updates reindexing progress via the
method `DataFrameAnalyticsTask.updateReindexTaskProgress()` we
end up overwriting the 100 with a lower progress value.

This commit fixes this issue by bringing back the help of
a `isReindexingFinished` flag as it was prior to elastic#55763.

Closes elastic#56128

Backport of elastic#56135
@elasticmachine
Copy link
Collaborator

Pinging @elastic/ml-core (:ml)

@dimitris-athanasiou
Copy link
Contributor Author

run elasticsearch-ci/packaging-sample-unix-docker

@dimitris-athanasiou dimitris-athanasiou merged commit 6061aa3 into elastic:7.x May 5, 2020
@dimitris-athanasiou dimitris-athanasiou deleted the fix-race-condition-updating-reindexing-progress-7x branch May 5, 2020 07:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants