-
Notifications
You must be signed in to change notification settings - Fork 24.9k
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
[Transform] Improve robustness when saving state #62086
Conversation
Pinging @elastic/ml-core (:ml/Transform) |
37e71c2
to
6f77dac
Compare
.../javaRestTest/java/org/elasticsearch/xpack/transform/integration/TransformIntegTestCase.java
Outdated
Show resolved
Hide resolved
.../javaRestTest/java/org/elasticsearch/xpack/transform/integration/TransformIntegTestCase.java
Outdated
Show resolved
Hide resolved
...ck/plugin/core/src/main/java/org/elasticsearch/xpack/core/indexing/AsyncTwoPhaseIndexer.java
Outdated
Show resolved
Hide resolved
...ck/plugin/core/src/main/java/org/elasticsearch/xpack/core/indexing/AsyncTwoPhaseIndexer.java
Outdated
Show resolved
Hide resolved
...ck/plugin/core/src/main/java/org/elasticsearch/xpack/core/indexing/AsyncTwoPhaseIndexer.java
Outdated
Show resolved
Hide resolved
...ugin/transform/src/main/java/org/elasticsearch/xpack/transform/transforms/TransformTask.java
Outdated
Show resolved
Hide resolved
...n/transform/src/main/java/org/elasticsearch/xpack/transform/transforms/TransformIndexer.java
Outdated
Show resolved
Hide resolved
Thanks @przemekwitek and @benwtrent, I addressed your comments. |
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.
LGTM
I've left one small comment but there is no need for another review.
.../javaRestTest/java/org/elasticsearch/xpack/transform/integration/TransformIntegTestCase.java
Outdated
Show resolved
Hide resolved
run elasticsearch-ci/bwc |
d0aa4ee
to
883ee76
Compare
run elasticsearch-ci/2 |
...n/transform/src/main/java/org/elasticsearch/xpack/transform/transforms/TransformIndexer.java
Outdated
Show resolved
Hide resolved
...n/transform/src/main/java/org/elasticsearch/xpack/transform/transforms/TransformIndexer.java
Outdated
Show resolved
Hide resolved
36f5ef4
to
5a475ad
Compare
run elasticsearch-ci/packaging-sample-windows |
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.
I think all the branches are covered.
Not a huge fan of a latch away within a sync block. But, this distributed synchronizing of 3 separate mutable state values is getting out of hand.
Our testing should catch any weird conditions over time.
run elasticsearch-ci/bwc |
21aa065
to
5a52149
Compare
run elasticsearch-ci/bwc |
5a52149
to
a7df454
Compare
…an 1 thread at the same time by moving it completely into the indexer.
…changed. Use optimistic lock for listeners
if start runs in parralel
a7df454
to
3b06daf
Compare
run elasticsearch-ci/2 |
run elasticsearch-ci/1 |
3 similar comments
run elasticsearch-ci/1 |
run elasticsearch-ci/1 |
run elasticsearch-ci/1 |
run elasticsearch-ci/1 (one last round :-) ) |
*/ | ||
final void setStopAtCheckpoint(boolean shouldStopAtCheckpoint, ActionListener<Void> shouldStopAtCheckpointListener) { | ||
// this should be called from the generic threadpool | ||
assert Thread.currentThread().getName().contains(ThreadPool.Names.GENERIC); |
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.
In testing (or where assertions are enabled), this would cause the caller to freeze and never return.
I am not sure how to assert here AND fire an onFailure
result. But, not doing so might cause some frustrating test investigations
refactor how state is persisted, call doSaveState only from the indexer thread, except there is none.
fixes #60781
fixes #52931
fixes #51629
fixes #52035