[ML] Ignore IndexNotFoundException when deleting quantiles (elastic/x-pack-elasticsearch#1507)
Relates elastic/elasticsearch#24518 Original commit: elastic/x-pack-elasticsearch@34ee52443c
This commit is contained in:
parent
527dcfd98d
commit
5b2ef6e98e
|
@ -109,7 +109,16 @@ public class JobStorageDeletionTask extends Task {
|
|||
|
||||
private void deleteQuantiles(String jobId, Client client, ActionListener<DeleteResponse> finishedHandler) {
|
||||
client.prepareDelete(AnomalyDetectorsIndex.jobStateIndexName(), Quantiles.TYPE.getPreferredName(), Quantiles.documentId(jobId))
|
||||
.execute(finishedHandler);
|
||||
.execute(ActionListener.wrap(
|
||||
finishedHandler::onResponse,
|
||||
e -> {
|
||||
// It's not a problem for us if the index wasn't found - it's equivalent to document not found
|
||||
if (e instanceof IndexNotFoundException) {
|
||||
finishedHandler.onResponse(new DeleteResponse());
|
||||
} else {
|
||||
finishedHandler.onFailure(e);
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
||||
private void deleteModelState(String jobId, Client client, ActionListener<BulkResponse> listener) {
|
||||
|
|
Loading…
Reference in New Issue