We have recently experienced multiple instabilities of our
elasticsearch cluster in codfw. First one on 2016-04-27 identified
around 10am UTC, second one on 2016-05-02 identified around 11pm UTC.
In both cases the symptoms were similar:
* a cluster restart was in progress to modify cluster discovery
strategy (moving from multicast to unicast ).
* cluster wide operations (get list of nodes, shards, changing cluster
settings) were extremely slow
* number of pending tasks (`curl -s
localhost:9200/_cluster/health?pretty | jq .number_of_pending_tasks`)
* most of those tasks were deletion of shards (`curl -s
localhost:9200/_cat/pending_tasks | grep indices_store | wc -l`)
* a few of them were deletion and creation of the
* response time of client requests did not seem to be affected
Only "more like" traffic is going to codfw. On the 27, we switched
this traffic to eqiad to buy time for investigation and recovery .
We found a copy/paste error in the cluster discovery configuration
. After a full cluster restart the situation stabilized.
On the 2, we did further investigation by capturing traffic and
looking for the cause of the deletion of the
"mediawiki_cirrussearch_frozen_indexes" index. We saw a high number of
deletion and creation requests for this index, coming from mediawiki
Further investigation show that Elastica (the library used by
CirrusSearch to communicate with Elasticsearch) does a recreate
(deletion followed by creation) to create a new index . This was
fixed quickly by disabling index creation . A more permanent fix
is tracked .
We suspect that this issue was seen only on codfw because of the
latency increasing the probability of a race condition between 2
* index creation / deletion can bring the cluster to its knees
* despite that, Elasticsearch is robust, client request do not seem to
have been affected
* the number of pending tasks raising seems to be a god indication of
cluster issues 
Big thanks to David and Erik for their support in this issue!
- not entirely sure about this reference
Operations Engineer, Discovery