v.20.5Improvement

Respect prefer_localhost_replica/load_balancing on INSERT into Distributed

Respect prefer_localhost_replica/load_balancing on INSERT into Distributed. #10867 (Azat Khuzhin).
Respect prefer_localhost_replica and load_balancing settings on INSERT operations into Distributed tables.

Why it matters

Previously, when inserting data into Distributed tables, the cluster settings prefer_localhost_replica and load_balancing were not considered, potentially leading to suboptimal replica selection and load distribution. This feature ensures that these settings are respected during INSERT operations, improving data locality preferences and balancing load according to user configuration.

How to use it

To use this feature, simply perform INSERT operations into Distributed tables as usual. Ensure that the settings prefer_localhost_replica and load_balancing are configured appropriately in your cluster or session settings. The INSERT will now respect these settings automatically.