As it is known that the order of execution of requests in a bulk request is not guaranteed, reason being the execution can happen on different nodes. But I'm curious to know what would happen in a case when the bulk request contain all the request for a single document id.
Lets assume a bulk request has three requests R1, R2, R3 where,
R1 : updates document with document id D1
R2 : updates document with document id D1
R3 : delete document with document id D1
Is it possible that R3 executes before R1 or R2 even though all these requests will be executed on the same node as all of them are for document D1?
If a bulk contains multiple operations on the same document then they are processed in order. However this is rather inefficient and if at all possible you should prefer to combine these operations into a single one before sending them to Elasticsearch. In your example, it would save a lot of time simply to delete the document and not send the two updates to Elasticsearch at all.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.