# For allocating unassigned replicas: Why does DiskThresholdDecider need free disk space \>= shard size when only a few MBs need to be recovered

**URL:** <https://discuss.elastic.co/t/for-allocating-unassigned-replicas-why-does-diskthresholddecider-need-free-disk-space-shard-size-when-only-a-few-mbs-need-to-be-recovered/230037>\
**Category:** Elasticsearch\
**Created:** [April 27, 2020, 9:43pm UTC](https://discuss.elastic.co/t/for-allocating-unassigned-replicas-why-does-diskthresholddecider-need-free-disk-space-shard-size-when-only-a-few-mbs-need-to-be-recovered/230037 "2020-04-27T21:43:52Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![UDixit](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/udixit/32/53219_2.png) [@UDixit](https://discuss.elastic.co/u/UDixit)\
**Post date:** [April 27, 2020, 9:43pm UTC](https://discuss.elastic.co/t/for-allocating-unassigned-replicas-why-does-diskthresholddecider-need-free-disk-space-shard-size-when-only-a-few-mbs-need-to-be-recovered/230037/1 "2020-04-27T21:43:52Z")

</div>

ES5; Index size ~500GB, ShardSize ~45GB each.

I have a 120GB disk and only 2 of the shards of this index are allocated on this disk.

Currently, these replica shards are unassigned, with reason NODE-LEFT, doing a PEER recovery but failing due to Disk ThresholdDecider decision.

: TraceLevel="WARN" [org.elasticsearch.cluster.routing.allocation.decider.DiskThresholdDecider] after allocating, node [ABC] would have less than the required 0b free bytes threshold (-6042180175 bytes free), preventing allocation  
"

The disk currently has \> 40GB of free disk space and the unassigned replica shards are already ~43-44GB in size and probably need to sync only a few MBs from the primary to be up to date. Why is DiskThresholdDecider preventing allocation in this scenario?

1. Why do we need free disk space \> = shard size for Peer recovery when only a few MBs need to be recovered?
2. The DiskThresholdDecider seems to be overly conservative in allowing allocation on a node based on disk space. Any ways to loosen up these constraints?

---

<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:** [May 25, 2020, 9:44pm UTC](https://discuss.elastic.co/t/for-allocating-unassigned-replicas-why-does-diskthresholddecider-need-free-disk-space-shard-size-when-only-a-few-mbs-need-to-be-recovered/230037/2 "2020-05-25T21:44:03Z")

</div>

Closed on May 25, 2020, 9:44pm UTC

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