Too quick?

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?

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 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?

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.

did you refresh after indexing?

On 21 Sep., 05:43, James Cook 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.

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.