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); } }