# Sequence numbers & indexing bottleneck

**URL:** <https://discuss.elastic.co/t/sequence-numbers-indexing-bottleneck/295614>\
**Category:** Elasticsearch\
**Created:** [January 27, 2022, 5:08pm UTC](https://discuss.elastic.co/t/sequence-numbers-indexing-bottleneck/295614 "2022-01-27T17:08:46Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![fhalde](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/fhalde/32/21419_2.png) [@fhalde](https://discuss.elastic.co/u/fhalde)\
**Post date:** [January 27, 2022, 5:08pm UTC](https://discuss.elastic.co/t/sequence-numbers-indexing-bottleneck/295614/1 "2022-01-27T17:08:46Z")

</div>

Hello,  
We are trying to debug a problem where indexing a document halts the ingestion pipeline on that particular shard

Taking into account the way sequence numbers are implemented, do documents get processed sequentially? I don't think so since ES has a write threadpool. At what point does the indexing fan out to leverage parallelism within a shard? What I'm trying to understand is, can a document A which is undergoing indexing and has been assigned with seqno=1 blocks indexing of document B with seqno=2 if it's taking time to index document A ? if not, then B with seqno=2 can be indexed before A gets indexed (and likewise visible in queries)? in that case what happens if A fails, what happens to the seqno=1? There has to be some sequential processing going on at some point right?

---

<div class="post-metadata">

**Author:** ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)\
**Post date:** [January 27, 2022, 9:07pm UTC](https://discuss.elastic.co/t/sequence-numbers-indexing-bottleneck/295614/2 "2022-01-27T21:07:48Z")

</div>

> [@fhalde](#):
>
> can a document A which is undergoing indexing and has been assigned with seqno=1 blocks indexing of document B with seqno=2 if it's taking time to index document A ?

No, once the seqno is assigned the indexing happens in parallel. Documents don't appear in seqno order indeed.

> [@fhalde](#):
>
> in that case what happens if A fails, what happens to the seqno=1?

It's turned into a no-op to mark that seqno as complete.

---

<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:** [February 24, 2022, 9:08pm UTC](https://discuss.elastic.co/t/sequence-numbers-indexing-bottleneck/295614/3 "2022-02-24T21:08:29Z")

</div>

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