Workaround for index request without an id being retried that are tripping an assertion in internal engine.

Original commit: elastic/x-pack-elasticsearch@ba44acc28b
This commit is contained in:
Martijn van Groningen 2017-01-27 16:14:00 +01:00
parent 64fdb039ab
commit ad4218320c
1 changed files with 3 additions and 1 deletions

View File

@ -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) {