From bdea6d65903dac101b333039fff3a31a5c8f8eba Mon Sep 17 00:00:00 2001 From: filimonov <1549571+filimonov@users.noreply.github.com> Date: Wed, 20 Nov 2024 21:55:30 +0100 Subject: [PATCH] respect prefer_locahost_replica=0 in parallel_distributed_insert_select --- src/Storages/StorageDistributed.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Storages/StorageDistributed.cpp b/src/Storages/StorageDistributed.cpp index cc55b2ae271..02b9751ae24 100644 --- a/src/Storages/StorageDistributed.cpp +++ b/src/Storages/StorageDistributed.cpp @@ -838,7 +838,7 @@ std::optional StorageDistributed::distributedWriteBetweenDistribu for (size_t shard_index : collections::range(0, shards_info.size())) { const auto & shard_info = shards_info[shard_index]; - if (shard_info.isLocal()) + if (shard_info.isLocal() && settings.prefer_localhost_replica) { InterpreterInsertQuery interpreter(new_query, query_context); pipeline.addCompletedPipeline(interpreter.execute().pipeline);