-
Notifications
You must be signed in to change notification settings - Fork 24.8k
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] Complete the Data Frame task on stop #41752
Conversation
Pinging @elastic/ml-core |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we are removing the persistent task from cluster state when stop
is called, there is no way to start it again from where the cursor is currently located.
Are there plans to check the IndexerState
when onSaveState
is called and determining if a indexed snapshot of the current cursor position and checkpoint should be made?
I think something like:
if (indexerState.equals(IndexerState.DELETING)) { ...take snapshot...}
would be a good idea. That way when start
is called again, the previous cursor position can be loaded up from the index.
...n/java/org/elasticsearch/xpack/dataframe/action/TransportDeleteDataFrameTransformAction.java
Outdated
Show resolved
Hide resolved
...n/java/org/elasticsearch/xpack/dataframe/action/TransportDeleteDataFrameTransformAction.java
Outdated
Show resolved
Hide resolved
There was a failure in test clean up after the multi node tests I made the stop action delegate to the master node for coordinating responses which should fix the problem |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should consider taking snapshots of the current cursor position and checkpoint so that transforms can be stopped, and then started again from the same spot.
@@ -76,7 +76,8 @@ | |||
@After | |||
public void cleanUpTransforms() throws IOException { | |||
for (String transformId : transformsToClean) { | |||
highLevelClient().dataFrame().stopDataFrameTransform(new StopDataFrameTransformRequest(transformId), RequestOptions.DEFAULT); | |||
highLevelClient().dataFrame().stopDataFrameTransform( | |||
new StopDataFrameTransformRequest(transformId, Boolean.TRUE, TimeValue.timeValueSeconds(20)), RequestOptions.DEFAULT); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Boolean.True
should probably just be true
f8e626b
to
c6b1047
Compare
This changes the behaviour of delete to simply remove the config after checking the DF does not have a running P task
c6b1047
to
51a17f0
Compare
run elasticsearch-ci/1 |
1 similar comment
run elasticsearch-ci/1 |
Wait for indexer to stop then complete the persistent task on stop. If the wait_for_completion is true the request will not return until stopped.
Wait for indexer to stop then complete the persistent task on stop. If the wait_for_completion is true the request will not return until stopped.
A call to
stop()
will cause the indexer to stop shortly after when the next search returns. The persistent task can only be completed once the indexer is stopped otherwise we have a zombie indexer spinning away but not accessible to the task manager. If thewait_for_completion
flag is true the stop requests waits for the persistent task to complete.I added a
onStop
event which is fired when the indexer stops. Note this is different toonFinish
which is triggered when the indexer completes the current phase.Delete is changed to simply check if the task is active and if not delete the data frame transform config.