elasticsearch/elasticsearch — Issue #1589: getting a doc should block/error if no master electedhttps://github.com/elasticsearch/elasticsearch/issues/new#write_bucket_24
Author: erickt
Created: 2012-01-05 16:14:34+00:00
State: open

When a node in a cluster reboots, there is a brief period of time while that node is searching for a master that that node can 404, even if `discovery.zen.minimum_master_nodes` equals 2:

% sudo service elasticsearch restart
...
time passes
...
% curl http://localhost:9200/index/type/id
{"error":"IndexMissingException[[index] missing]","status":404}
% curl http://localhost:9200/_cluster/health
{"error" : "MasterNotDiscoveredException[]", "status" : 500}

Since this is the same error message you get when the there's actually no index, I need to check with /_cluster/health to see if the cluster is in this startup phase to tell if this is a temporary error or not. It'd be preferable if instead elasticsearch could just raise a separate error so I don't need to do that.