I've seen issues when running on larger clusters caused by index shrink. The root cause of these issues tends to be the requirement for all shards to be recovered on a single node, as this can cause significant hotspots in the cluster, require significant (temporary) disk+memory utilization on that node and has been the cause of a couple of significant outages for our product in the past. In most cases the best way to address this has been to effectively have dedicated nodes for performing the shrink and recovery, to avoid any impact on normal search and indexing operations (as well as tuning index recovery bandwidth etc. with limited success).
I spent some time looking at the code for this and thinking about ways it could be improved and while the actual shard recovery itself already works perfectly well when only recovering an individual shard, the allocation of specific shards to specific nodes is not possible with the existing discovery filters.
I had the idea of creating a allocation decider that allows you to define a group of node IDs and then allows allocation of (primary) shards to node_group[shard_id % len(node_group)]
, with a small adjustment to which source shards get selected for a shrunk shard, this allows you to define the shrink operation in terms of the locations of the target shards and so spread the recovery across all of those nodes.
Before I go too far actually implementing this properly (adding tests, integrating with ILM/existing settings etc.) I wanted to get some opinions on this approach to see if it's a worthwhile change and if there is anything I've missed in my thought process.