From ef25e2b604e0ffe1bf08c462b48f20b7296085ca Mon Sep 17 00:00:00 2001 From: David Roberts Date: Wed, 31 May 2017 14:36:43 +0100 Subject: [PATCH] [ML] When deleting a filter refresh the index immediately (elastic/x-pack-elasticsearch#1587) Otherwise it's possible that the get_filter endpoint can return a filter that's been deleted. Although this is the behaviour of the search API, specific metadata management APIs should provide better guarantees. Original commit: elastic/x-pack-elasticsearch@818495f176d336ba166170feba6b0e6fab387a84 --- .../org/elasticsearch/xpack/ml/action/DeleteFilterAction.java | 2 ++ .../java/org/elasticsearch/xpack/ml/action/PutFilterAction.java | 2 ++ 2 files changed, 4 insertions(+) diff --git a/plugin/src/main/java/org/elasticsearch/xpack/ml/action/DeleteFilterAction.java b/plugin/src/main/java/org/elasticsearch/xpack/ml/action/DeleteFilterAction.java index 0bab0bccab5..5e9b9c939bb 100644 --- a/plugin/src/main/java/org/elasticsearch/xpack/ml/action/DeleteFilterAction.java +++ b/plugin/src/main/java/org/elasticsearch/xpack/ml/action/DeleteFilterAction.java @@ -15,6 +15,7 @@ import org.elasticsearch.action.bulk.TransportBulkAction; import org.elasticsearch.action.delete.DeleteRequest; import org.elasticsearch.action.support.ActionFilters; import org.elasticsearch.action.support.HandledTransportAction; +import org.elasticsearch.action.support.WriteRequest; import org.elasticsearch.action.support.master.AcknowledgedRequest; import org.elasticsearch.action.support.master.AcknowledgedResponse; import org.elasticsearch.action.support.master.MasterNodeOperationRequestBuilder; @@ -182,6 +183,7 @@ public class DeleteFilterAction extends Action() { @Override public void onResponse(BulkResponse bulkResponse) { diff --git a/plugin/src/main/java/org/elasticsearch/xpack/ml/action/PutFilterAction.java b/plugin/src/main/java/org/elasticsearch/xpack/ml/action/PutFilterAction.java index c4e70563d5b..d7fdf1d34a3 100644 --- a/plugin/src/main/java/org/elasticsearch/xpack/ml/action/PutFilterAction.java +++ b/plugin/src/main/java/org/elasticsearch/xpack/ml/action/PutFilterAction.java @@ -15,6 +15,7 @@ import org.elasticsearch.action.bulk.TransportBulkAction; import org.elasticsearch.action.index.IndexRequest; import org.elasticsearch.action.support.ActionFilters; import org.elasticsearch.action.support.HandledTransportAction; +import org.elasticsearch.action.support.WriteRequest; import org.elasticsearch.action.support.master.AcknowledgedResponse; import org.elasticsearch.action.support.master.MasterNodeOperationRequestBuilder; import org.elasticsearch.action.support.master.MasterNodeReadRequest; @@ -182,6 +183,7 @@ public class PutFilterAction extends Action() { @Override