From ad4218320ca1db2c0226f6089cc04dd4ac3df957 Mon Sep 17 00:00:00 2001 From: Martijn van Groningen Date: Fri, 27 Jan 2017 16:14:00 +0100 Subject: [PATCH] Workaround for index request without an id being retried that are tripping an assertion in internal engine. Original commit: elastic/x-pack-elasticsearch@ba44acc28b376a4fd66fedc5a44e6efed1b940cc --- .../xpack/ml/job/persistence/JobResultsPersister.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/elasticsearch/src/main/java/org/elasticsearch/xpack/ml/job/persistence/JobResultsPersister.java b/elasticsearch/src/main/java/org/elasticsearch/xpack/ml/job/persistence/JobResultsPersister.java index 87f59cd2d3c..1d6cc54af62 100644 --- a/elasticsearch/src/main/java/org/elasticsearch/xpack/ml/job/persistence/JobResultsPersister.java +++ b/elasticsearch/src/main/java/org/elasticsearch/xpack/ml/job/persistence/JobResultsPersister.java @@ -12,6 +12,7 @@ import org.elasticsearch.action.bulk.BulkRequest; import org.elasticsearch.action.bulk.BulkResponse; import org.elasticsearch.action.index.IndexRequest; import org.elasticsearch.client.Client; +import org.elasticsearch.common.UUIDs; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.component.AbstractComponent; import org.elasticsearch.common.settings.Settings; @@ -358,7 +359,8 @@ public class JobResultsPersister extends AbstractComponent { this.jobId = jobId; this.object = object; this.type = type; - this.id = id; + // TODO: (norelease): Fix the assertion tripping in internal engine for index requests without an id being retried: + this.id = id != null ? id : UUIDs.base64UUID(); } boolean persist(String indexName) {