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

[ML] Fix race condition updating reindexing progress #56135

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

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
@elasticmachine
Copy link
Collaborator

Pinging @elastic/ml-core (:ml)

@benwtrent benwtrent self-requested a review May 4, 2020 18:08
@dimitris-athanasiou dimitris-athanasiou merged commit 5724eda into elastic:master May 4, 2020
@dimitris-athanasiou dimitris-athanasiou deleted the fix-race-condition-updating-reindexing-progress branch May 4, 2020 18:48
dimitris-athanasiou added a commit that referenced this pull request May 5, 2020
…56146)

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants