# Too quick?

**URL:** <https://discuss.elastic.co/t/too-quick/5420>\
**Category:** Elasticsearch\
**Created:** [September 20, 2011, 9:48pm UTC](https://discuss.elastic.co/t/too-quick/5420 "2011-09-20T21:48:37Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![James\_Cook](https://avatars.discourse-cdn.com/v4/letter/j/898d66/32.png) [@James\_Cook](https://discuss.elastic.co/u/James_Cook)\
**Post date:** [September 20, 2011, 9:48pm UTC](https://discuss.elastic.co/t/too-quick/5420/1 "2011-09-20T21:48:37Z")

</div>

I have a unit test that programmatically starts the ES server with a single  
data node, waits for YELLOW state (using the default 5/2 config), and then  
indexes a document. This document fails to index, but one followed up a few  
ms. later indexes ok. If I sleep for a few millis before performing the fist  
index, the first index succeeds. Using 0.17.6. Is there any API check I can  
perform to make sure ES is ready?

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [September 20, 2011, 10:06pm UTC](https://discuss.elastic.co/t/too-quick/5420/2 "2011-09-20T22:06:50Z")

</div>

The default config is 5 shards and 1 replica. If you wait for a yellow  
status, you should not get a failure when indexing. Even if you do not wait  
for a yellow state and index, the indexing operation will wait (up to a  
timeout, defaults to 1 minute) for a shard to become available to index  
into.

What exception do you get?

On Wed, Sep 21, 2011 at 12:48 AM, James Cook [jcook@tracermedia.com](mailto:jcook@tracermedia.com) wrote:

> I have a unit test that programmatically starts the ES server with a single  
> data node, waits for YELLOW state (using the default 5/2 config), and then  
> indexes a document. This document fails to index, but one followed up a few  
> ms. later indexes ok. If I sleep for a few millis before performing the fist  
> index, the first index succeeds. Using 0.17.6. Is there any API check I can  
> perform to make sure ES is ready?

---

<div class="post-metadata">

**Author:** ![James\_Cook](https://avatars.discourse-cdn.com/v4/letter/j/898d66/32.png) [@James\_Cook](https://discuss.elastic.co/u/James_Cook)\
**Post date:** [September 21, 2011, 3:43am UTC](https://discuss.elastic.co/t/too-quick/5420/3 "2011-09-21T03:43:24Z")

</div>

I don't get an exception, but since I am using ES as a backing store for  
Hazelcast, perhaps it is Hazelcast which isn't ready to start writing data  
to ES. I will have to debug this further.

---

<div class="post-metadata">

**Author:** ![Karussell1](https://avatars.discourse-cdn.com/v4/letter/k/50afbb/32.png) [@Karussell1](https://discuss.elastic.co/u/Karussell1)\
**Post date:** [September 22, 2011, 8:30pm UTC](https://discuss.elastic.co/t/too-quick/5420/4 "2011-09-22T20:30:15Z")

</div>

did you refresh after indexing?

On 21 Sep., 05:43, James Cook [jc...@tracermedia.com](mailto:jc...@tracermedia.com) wrote:

> I don't get an exception, but since I am using ES as a backing store for  
> Hazelcast, perhaps it is Hazelcast which isn't ready to start writing data  
> to ES. I will have to debug this further.

---

<div class="post-metadata">

**Author:** ![James\_Cook](https://avatars.discourse-cdn.com/v4/letter/j/898d66/32.png) [@James\_Cook](https://discuss.elastic.co/u/James_Cook)\
**Post date:** [September 22, 2011, 8:48pm UTC](https://discuss.elastic.co/t/too-quick/5420/5 "2011-09-22T20:48:40Z")

</div>

I did refresh and I saw the log entries for refresh. I think the problem  
must be in Hazelcast. For some reason it is not calling the MapStore  
interface which calls elasticsearch.

---

<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:** [July 6, 2017, 3:53am UTC](https://discuss.elastic.co/t/too-quick/5420/6 "2017-07-06T03:53:44Z")

</div>


