# updateByQuery cluster state red

**URL:** https://discuss.elastic.co/t/updatebyquery-cluster-state-red/97555
**Category:** Elasticsearch
**Created:** [August 18, 2017, 9:56am UTC](https://discuss.elastic.co/t/updatebyquery-cluster-state-red/97555 "2017-08-18T09:56:13Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![prigornitskiy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/prigornitskiy/32/21253_2.png) [@prigornitskiy](https://discuss.elastic.co/u/prigornitskiy)
#### Post date: [August 18, 2017, 9:56am UTC](https://discuss.elastic.co/t/updatebyquery-cluster-state-red/97555/1 "2017-08-18T09:56:14Z")

</div>

Steps to reproduce:

1. insert 45 000 000 documents
2. run:  
`let res = await client.updateByQuery({ index: config.get('index'), type: config.get('type'), slices: 5, waitForCompletion: false, conflicts: "proceed", requestTimeout: 36000000, timeout: -1, body: { "query": { "bool": { "must": { "match_all": {} }, "filter": { "bool": { "must": [{ "exists": { "field": "offers" } }] } } } }, "script": { "lang": "painless", "inline": 'for (int i = 0; i < ctx._source.offers.length; i++) {ctx._source.offers[i].price_usd = ctx._source.offers[i].price / params.toUSD[ctx._source.offers[i].code]}', "params": { "toUSD": params } } } })`
3. After a while the cluster status will become red

Is it possible to update all records in index?

---

<div class="post-metadata">

### Author: ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)
#### Post date: [August 18, 2017, 10:02am UTC](https://discuss.elastic.co/t/updatebyquery-cluster-state-red/97555/2 "2017-08-18T10:02:17Z")

</div>

Why does the cluster go red? Are there any errors or warnings in the Elasticsearch logs? What does your documents look like?

---

<div class="post-metadata">

### Author: ![prigornitskiy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/prigornitskiy/32/21253_2.png) [@prigornitskiy](https://discuss.elastic.co/u/prigornitskiy)
#### Post date: [August 18, 2017, 10:16am UTC](https://discuss.elastic.co/t/updatebyquery-cluster-state-red/97555/3 "2017-08-18T10:16:29Z")

</div>

We've just found the problem on one of our nodes.  
No space left on device  
During the updating elasticsearch eat a lot of space on disk. May be you know what can we do with it?

---

<div class="post-metadata">

### Author: ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)
#### Post date: [August 19, 2017, 1:45pm UTC](https://discuss.elastic.co/t/updatebyquery-cluster-state-red/97555/4 "2017-08-19T13:45:37Z")

</div>

As Elasticsearch is working on of a point-in-time snapshot when the update by query operation starts, this dataset needs to remain, even if every document gets replaced. So if your update query operation affects a lot of documents, you need to have in the worst case twice the amount of index size available on disk.

---

<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: [September 16, 2017, 1:45pm UTC](https://discuss.elastic.co/t/updatebyquery-cluster-state-red/97555/5 "2017-09-16T13:45:39Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
