# Should ordering of items in BulkRequest and BulkResponse match if java client BulkProcessor is used and requests are retried?

**URL:** <https://discuss.elastic.co/t/should-ordering-of-items-in-bulkrequest-and-bulkresponse-match-if-java-client-bulkprocessor-is-used-and-requests-are-retried/273101>\
**Category:** Elasticsearch\
**Created:** [May 16, 2021, 7:58am UTC](https://discuss.elastic.co/t/should-ordering-of-items-in-bulkrequest-and-bulkresponse-match-if-java-client-bulkprocessor-is-used-and-requests-are-retried/273101 "2021-05-16T07:58:34Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Chobicus](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/chobicus/32/88720_2.png) [@Chobicus](https://discuss.elastic.co/u/Chobicus)\
**Post date:** [May 16, 2021, 7:58am UTC](https://discuss.elastic.co/t/should-ordering-of-items-in-bulkrequest-and-bulkresponse-match-if-java-client-bulkprocessor-is-used-and-requests-are-retried/273101/1 "2021-05-16T07:58:35Z")

</div>

Based on [the code](https://github.com/elastic/elasticsearch/blob/master/server/src/main/java/org/elasticsearch/action/bulk/Retry.java#L98-L100) that is used for retrying it seems that the ordering of items in `BulkRequest` and `BulkResponse` do not match. e.g. `BulkRequest` might contain items `foo1`, `foo2`, `foo3`... and the `BulkResponse`, if retry mechanism kicks in, might have ordering `foo3`, `foo1`, `foo2`...  
I can not find the documentation on if this is intended or it is a bug.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [June 13, 2021, 7:59am UTC](https://discuss.elastic.co/t/should-ordering-of-items-in-bulkrequest-and-bulkresponse-match-if-java-client-bulkprocessor-is-used-and-requests-are-retried/273101/2 "2021-06-13T07:59:27Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
