I agree that this seems like a bug (either in the code or the 
documentation).  The documentation 
<http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/cluster-health.html>
 says 
it will wait "until the status of the cluster changes to the one provided" 
which is not true.

Our current workflow for a rolling restart checks that the cluster goes 
yellow after a data node leaves.  We are using polling to validate this, 
but I would much rather have a blocking wait call.

-T

On Thursday, May 22, 2014 9:20:48 AM UTC-7, Ivan Brusic wrote:
>
> While doing some tests, I thought I uncovered a bug in the 
> cluster-health/wait-for-yellow request. No matter what settings I tried, 
> the request would always return immediately with no timeout. I then 
> realized that the request is actually something like "wait for AT LEAST 
> yellow state". In other words, a GREEN state would satisfy a wait for 
> YELLOW state.
>
> The code in question
>
>
> https://github.com/elasticsearch/elasticsearch/blob/master/src/main/java/org/elasticsearch/action/admin/cluster/health/TransportClusterHealthAction.java#L132
>
> *response.getStatus().value() <= request.waitForStatus().value()*
>
> Obviously few people are interested in waiting for when a cluster goes 
> from GREEN to YELLLOW, but I am one of those few. I would love to propose a 
> true wait-for-yellow (and even red), but it would be difficult to come up 
> with an appropriately named call since the waitForYellow is taken and 
> should be renamed (breaking code in the process).
>
> I am assuming the current code is a feature and not a bug, in which case 
> the documentation should reflect that thinking (willing to fix). But in the 
> meantime, how can one be notified if a cluster changes its state from GREEN 
> without constant polling?
>
> Cheers,
>
> Ivan
>

-- 
You received this message because you are subscribed to the Google Groups 
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/54c594b9-3780-4ba6-9fd1-6f9609a622d1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to