v.21.9Improvement

Fix excessive connect attempts with skip_unavailable_shards

Fix excessive (x2) connect attempts with skip_unavailable_shards. #26658 (Azat Khuzhin).
Fixes the issue of excessive duplicated connection attempts when using the skip_unavailable_shards setting.

Why it matters

This feature addresses the problem of redundant connection attempts being made twice as often as necessary when skip_unavailable_shards is enabled. It improves efficiency by reducing unnecessary connection overhead, leading to better resource usage and faster query processing.

How to use it

To benefit from this fix, simply enable the skip_unavailable_shards setting as usual in your distributed table configuration. The improved connection logic is applied automatically after upgrading to the version including this fix.