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

Original commit: elastic/x-pack-elasticsearch@22d5060deb
This commit is contained in:
Martijn van Groningen 2017-01-27 17:07:30 +01:00
parent ad4218320c
commit 2059b91620
1 changed files with 3 additions and 1 deletions

View File

@ -10,6 +10,7 @@ import org.apache.logging.log4j.message.ParameterizedMessage;
import org.elasticsearch.action.ActionListener;
import org.elasticsearch.action.index.IndexResponse;
import org.elasticsearch.client.Client;
import org.elasticsearch.common.UUIDs;
import org.elasticsearch.common.logging.Loggers;
import org.elasticsearch.common.xcontent.ToXContent;
import org.elasticsearch.common.xcontent.XContentBuilder;
@ -50,7 +51,8 @@ public class Auditor {
}
private void indexDoc(String type, ToXContent toXContent) {
client.prepareIndex(NOTIFICATIONS_INDEX, type)
// TODO: (norelease): Fix the assertion tripping in internal engine for index requests without an id being retried:
client.prepareIndex(NOTIFICATIONS_INDEX, type, UUIDs.base64UUID())
.setSource(toXContentBuilder(toXContent))
.execute(new ActionListener<IndexResponse>() {
@Override