How are shards chosen when disk usage exceeds high water mark?

I appreciate if I could get help to understand behavior of disk high watermark in elasticsearch.

From the document, I have understood that when disk usage of the partion where path.data exists exceeds high watemark then shards will begin to be relocated to other nodes.

Controls the high watermark. It defaults to 90% , meaning that Elasticsearch will attempt to relocate shards away from a node whose disk usage is above 90%

But how will the shards chosen that needs to be relocated ? Will be chosen from the largest ones ?

I came across with this code , but couldn't find the part where it decides the shard.

The order is undefined, and no effort is made to move the largest or smallest shards first. Here is the loop that goes through the shards checking whether they can remain:

And here is the decider:

I see. I will mark your comment as solution.

1 Like

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