[ML] Refresh index after delete (elastic/x-pack-elasticsearch#1675)
Original commit: elastic/x-pack-elasticsearch@fbbcd0343e
This commit is contained in:
parent
d64bea14dc
commit
02a241bdf5
|
@ -114,6 +114,7 @@ public class JobStorageDeletionTask extends Task {
|
||||||
searchRequest.source(new SearchSourceBuilder().query(query));
|
searchRequest.source(new SearchSourceBuilder().query(query));
|
||||||
searchRequest.indicesOptions(JobProvider.addIgnoreUnavailable(IndicesOptions.lenientExpandOpen()));
|
searchRequest.indicesOptions(JobProvider.addIgnoreUnavailable(IndicesOptions.lenientExpandOpen()));
|
||||||
request.setAbortOnVersionConflict(false);
|
request.setAbortOnVersionConflict(false);
|
||||||
|
request.setRefresh(true);
|
||||||
|
|
||||||
client.execute(DeleteByQueryAction.INSTANCE, request, ActionListener.wrap(
|
client.execute(DeleteByQueryAction.INSTANCE, request, ActionListener.wrap(
|
||||||
response -> finishedHandler.onResponse(true),
|
response -> finishedHandler.onResponse(true),
|
||||||
|
@ -149,6 +150,7 @@ public class JobStorageDeletionTask extends Task {
|
||||||
searchRequest.source(new SearchSourceBuilder().query(query));
|
searchRequest.source(new SearchSourceBuilder().query(query));
|
||||||
searchRequest.indicesOptions(JobProvider.addIgnoreUnavailable(IndicesOptions.lenientExpandOpen()));
|
searchRequest.indicesOptions(JobProvider.addIgnoreUnavailable(IndicesOptions.lenientExpandOpen()));
|
||||||
request.setAbortOnVersionConflict(false);
|
request.setAbortOnVersionConflict(false);
|
||||||
|
request.setRefresh(true);
|
||||||
|
|
||||||
client.execute(DeleteByQueryAction.INSTANCE, request, ActionListener.wrap(
|
client.execute(DeleteByQueryAction.INSTANCE, request, ActionListener.wrap(
|
||||||
response -> {
|
response -> {
|
||||||
|
|
|
@ -180,9 +180,6 @@
|
||||||
index: ".ml-anomalies-shared"
|
index: ".ml-anomalies-shared"
|
||||||
- is_true: ''
|
- is_true: ''
|
||||||
|
|
||||||
- do:
|
|
||||||
indices.refresh: {}
|
|
||||||
|
|
||||||
- do:
|
- do:
|
||||||
count:
|
count:
|
||||||
index: .ml-state
|
index: .ml-state
|
||||||
|
@ -249,9 +246,6 @@
|
||||||
index: ".ml-anomalies-index-layout-job2"
|
index: ".ml-anomalies-index-layout-job2"
|
||||||
- is_false: ''
|
- is_false: ''
|
||||||
|
|
||||||
- do:
|
|
||||||
indices.refresh: {}
|
|
||||||
|
|
||||||
- do:
|
- do:
|
||||||
count:
|
count:
|
||||||
type: doc
|
type: doc
|
||||||
|
@ -379,9 +373,6 @@
|
||||||
index: "foo"
|
index: "foo"
|
||||||
- is_true: ''
|
- is_true: ''
|
||||||
|
|
||||||
- do:
|
|
||||||
indices.refresh: {}
|
|
||||||
|
|
||||||
- do:
|
- do:
|
||||||
count:
|
count:
|
||||||
index: .ml-state
|
index: .ml-state
|
||||||
|
@ -392,6 +383,9 @@
|
||||||
index: .ml-anomalies-shared
|
index: .ml-anomalies-shared
|
||||||
- match: {count: 0}
|
- match: {count: 0}
|
||||||
|
|
||||||
|
- do:
|
||||||
|
indices.refresh: {}
|
||||||
|
|
||||||
- do:
|
- do:
|
||||||
count:
|
count:
|
||||||
index: foo
|
index: foo
|
||||||
|
@ -436,9 +430,6 @@
|
||||||
job_id: "index-layout-quantiles-job"
|
job_id: "index-layout-quantiles-job"
|
||||||
- match: { acknowledged: true }
|
- match: { acknowledged: true }
|
||||||
|
|
||||||
- do:
|
|
||||||
indices.refresh: {}
|
|
||||||
|
|
||||||
- do:
|
- do:
|
||||||
count:
|
count:
|
||||||
index: .ml-state
|
index: .ml-state
|
||||||
|
@ -509,17 +500,11 @@
|
||||||
body:
|
body:
|
||||||
state: more-new-categorizer-state
|
state: more-new-categorizer-state
|
||||||
|
|
||||||
- do:
|
|
||||||
indices.refresh: {}
|
|
||||||
|
|
||||||
- do:
|
- do:
|
||||||
xpack.ml.delete_job:
|
xpack.ml.delete_job:
|
||||||
job_id: "index-layout-state-job"
|
job_id: "index-layout-state-job"
|
||||||
- match: { acknowledged: true }
|
- match: { acknowledged: true }
|
||||||
|
|
||||||
- do:
|
|
||||||
indices.refresh: {}
|
|
||||||
|
|
||||||
- do:
|
- do:
|
||||||
count:
|
count:
|
||||||
index: .ml-anomalies-shared
|
index: .ml-anomalies-shared
|
||||||
|
|
Loading…
Reference in New Issue