After allocating node would have less than the required threshold of – How to solve this Elasticsearch error

Opster Team

Aug-23, Version: 6.8-7.15

Briefly, this error occurs when Elasticsearch attempts to allocate a shard to a node, but doing so would leave the node with less free disk space than the set threshold. This is a safeguard to prevent nodes from running out of disk space. To resolve this issue, you can either increase the disk space available on the node, decrease the amount of data stored on the node by deleting unnecessary indices or shards, or adjust the disk watermark thresholds in the Elasticsearch settings to allow more disk space to be used before triggering this error.

This guide will help you check for common problems that cause the log ” after allocating [{}] node [{}] would have less than the required threshold of ” to appear. To understand the issues related to this log, read the explanation below about the following Elasticsearch concepts: allocation, node, threshold, routing, cluster.

Log Context

Log “after allocating [{}] node [{}] would have less than the required threshold of ” classname is DiskThresholdDecider.java.
We extracted the following from Elasticsearch source code for those seeking an in-depth context :

            allocation.clusterInfo(); allocation.snapshotShardSizeInfo(); allocation.metadata(); allocation.routingTable());
        assert shardSize >= 0 : shardSize;
        double freeSpaceAfterShard = freeDiskPercentageAfterShardAssigned(usage; shardSize);
        long freeBytesAfterShard = freeBytes - shardSize;
        if (freeBytesAfterShard 

 

 [ratemypost]