From c43a13cb81fd90b91d8d8a94ef872ee8baf110f0 Mon Sep 17 00:00:00 2001 From: Nikolai Kochetov Date: Wed, 23 Aug 2017 13:23:16 +0300 Subject: [PATCH] fixed async insertion into local shard of distributed [#CLICKHOUSE-3245] --- dbms/src/Storages/Distributed/DistributedBlockOutputStream.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dbms/src/Storages/Distributed/DistributedBlockOutputStream.cpp b/dbms/src/Storages/Distributed/DistributedBlockOutputStream.cpp index 046a4b500df..9a9d6f76743 100644 --- a/dbms/src/Storages/Distributed/DistributedBlockOutputStream.cpp +++ b/dbms/src/Storages/Distributed/DistributedBlockOutputStream.cpp @@ -367,7 +367,8 @@ void DistributedBlockOutputStream::writeAsyncImpl(const Block & block, const siz for (const auto & address : cluster->getShardsAddresses()[shard_id]) if (!address.is_local) dir_names.push_back(address.toStringFull()); - writeToShard(block, dir_names); + if (!dir_names.empty()) + writeToShard(block, dir_names); } }