# How do create a threshold for read\_only\_allow\_delete?

**URL:** <https://discuss.elastic.co/t/how-do-create-a-threshold-for-read-only-allow-delete/198296>\
**Category:** Elasticsearch\
**Created:** [September 5, 2019, 5:03pm UTC](https://discuss.elastic.co/t/how-do-create-a-threshold-for-read-only-allow-delete/198296 "2019-09-05T17:03:53Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Luis\_Alejandro\_Galan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/luis_alejandro_galan/32/32746_2.png) [@Luis\_Alejandro\_Galan](https://discuss.elastic.co/u/Luis_Alejandro_Galan)\
**Post date:** [September 5, 2019, 5:03pm UTC](https://discuss.elastic.co/t/how-do-create-a-threshold-for-read-only-allow-delete/198296/1 "2019-09-05T17:03:54Z")

</div>

Hello! I am running to an issue where my indices lock after it reaches a certain limit. Where can I find the limit and/or how can I adjust it so that it only locks when it reaches 5% of disk space used?

---

<div class="post-metadata">

**Author:** ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)\
**Post date:** [September 5, 2019, 5:46pm UTC](https://discuss.elastic.co/t/how-do-create-a-threshold-for-read-only-allow-delete/198296/2 "2019-09-05T17:46:14Z")

</div>

You are looking for the flood-stage watermark, documented [on the page on disk-based shard allocation](https://www.elastic.co/guide/en/elasticsearch/reference/current/disk-allocator.html). It defaults to 95%.

> [@Luis\_Alejandro\_Galan](#):
>
> locks when it reaches 5% of disk space used?

Do you mean "free" instead of "used"? Marking indices as readonly at 5% disk usage seems like a strange choice. The default is to mark them readonly at 95% disk usage (i.e. 5% disk free).

---

<div class="post-metadata">

**Author:** ![Luis\_Alejandro\_Galan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/luis_alejandro_galan/32/32746_2.png) [@Luis\_Alejandro\_Galan](https://discuss.elastic.co/u/Luis_Alejandro_Galan)\
**Post date:** [September 5, 2019, 6:27pm UTC](https://discuss.elastic.co/t/how-do-create-a-threshold-for-read-only-allow-delete/198296/3 "2019-09-05T18:27:28Z")

</div>

Yes correct I meant "free" space. I am currently using the following command to unlock it.  
PUT \_settings  
{  
"index": {  
"blocks": {  
"read\_only\_allow\_delete": "false"  
}  
}  
}

How do I update this to a 3% usage lock in the elastic search .yml file?

---

<div class="post-metadata">

**Author:** ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)\
**Post date:** [September 5, 2019, 7:02pm UTC](https://discuss.elastic.co/t/how-do-create-a-threshold-for-read-only-allow-delete/198296/4 "2019-09-05T19:02:55Z")

</div>

Add this line, as per the docs I shared above:

`cluster.routing.allocation.disk.watermark.flood_stage: 97%`

---

<div class="post-metadata">

**Author:** ![Luis\_Alejandro\_Galan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/luis_alejandro_galan/32/32746_2.png) [@Luis\_Alejandro\_Galan](https://discuss.elastic.co/u/Luis_Alejandro_Galan)\
**Post date:** [September 5, 2019, 7:45pm UTC](https://discuss.elastic.co/t/how-do-create-a-threshold-for-read-only-allow-delete/198296/5 "2019-09-05T19:45:33Z")

</div>

Ah, I see, you can use any of these lines in the yml file 🙂

Very good to know, thanks David!

---

<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:** [October 3, 2019, 7:58pm UTC](https://discuss.elastic.co/t/how-do-create-a-threshold-for-read-only-allow-delete/198296/6 "2019-10-03T19:58:18Z")

</div>

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