# What is the behaviour of Bulkporocessor when elastic search server restarts often

**URL:** <https://discuss.elastic.co/t/what-is-the-behaviour-of-bulkporocessor-when-elastic-search-server-restarts-often/74007>\
**Category:** Elasticsearch\
**Created:** [February 6, 2017, 4:38am UTC](https://discuss.elastic.co/t/what-is-the-behaviour-of-bulkporocessor-when-elastic-search-server-restarts-often/74007 "2017-02-06T04:38:44Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![nagendrababug](https://avatars.discourse-cdn.com/v4/letter/n/ecc23a/32.png) [@nagendrababug](https://discuss.elastic.co/u/nagendrababug)\
**Post date:** [February 6, 2017, 4:38am UTC](https://discuss.elastic.co/t/what-is-the-behaviour-of-bulkporocessor-when-elastic-search-server-restarts-often/74007/1 "2017-02-06T04:38:44Z")

</div>

I have been using bulk processor API to send messages to elastic search.Some times elastic gets restarted often, then i observed that I lost some [messages.Is](http://messages.Is) this because of elastic or bulk processor.  
Please suggest me.

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [February 6, 2017, 5:36am UTC](https://discuss.elastic.co/t/what-is-the-behaviour-of-bulkporocessor-when-elastic-search-server-restarts-often/74007/2 "2017-02-06T05:36:17Z")

</div>

Bulkprocessor does not retry in case of failure.

You must read the bulk response to see if there are individual failures or catch the Exception in case of a global failure.

Then retry if needed.

But stopping elasticsearch often is not a best practice. Why are you doing that?

---

<div class="post-metadata">

**Author:** ![nagendrababug](https://avatars.discourse-cdn.com/v4/letter/n/ecc23a/32.png) [@nagendrababug](https://discuss.elastic.co/u/nagendrababug)\
**Post date:** [February 6, 2017, 6:26am UTC](https://discuss.elastic.co/t/what-is-the-behaviour-of-bulkporocessor-when-elastic-search-server-restarts-often/74007/3 "2017-02-06T06:26:47Z")

</div>

Hi David,  
Thanks for your reply.  
Some times Even if i don't retry also i can able to see messages sent to elastic search once it is started.Some times i have observed that adding failed messages leading to duplicate sending to elastic search.  
Suppose i am sending 100000 records to elastic search using bulk processor, If elastic search gets down while processing bulkprocessor requests.@afterbulk method called with throwable exception and failed request.  
If add failed messages to bulk processor and restarted elastic then observed that 100100 messages received by elastic search .  
If I did not add failed messages then observed that 99900 messages received by elastic search .  
Why is this happening?  
Suggest me if i am wrong.

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [February 6, 2017, 6:12pm UTC](https://discuss.elastic.co/t/what-is-the-behaviour-of-bulkporocessor-when-elastic-search-server-restarts-often/74007/4 "2017-02-06T18:12:23Z")

</div>

If elasticsearch goes down before it proceeds the full bulk, then nothing should be indexed.  
If you get a response from elasticsearch, it means it is at least in the transaction log. So when your node restart it should be played again.

But do you have only one node?

---

<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:** [March 6, 2017, 6:12pm UTC](https://discuss.elastic.co/t/what-is-the-behaviour-of-bulkporocessor-when-elastic-search-server-restarts-often/74007/5 "2017-03-06T18:12:29Z")

</div>

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