v.21.6Improvement

Do not optimize unused shards for single-node cluster

Do not perform optimize_skip_unused_shards for cluster with one node. #22999 (Azat Khuzhin).
Prevent the execution of optimize_skip_unused_shards on clusters that contain only a single node.

Why it matters

This feature avoids unnecessary optimization operations on single-node clusters, where skipping unused shards is irrelevant. It helps to improve efficiency and prevent redundant processing in such cluster setups.

How to use it

The change is applied automatically; users do not need to enable anything. When running optimize_skip_unused_shards on a cluster with only one node, the operation will be skipped by default.