diff --git a/dbms/src/Interpreters/Cluster.cpp b/dbms/src/Interpreters/Cluster.cpp index 665ee5af1ed..b57d2ab5b50 100644 --- a/dbms/src/Interpreters/Cluster.cpp +++ b/dbms/src/Interpreters/Cluster.cpp @@ -139,7 +139,8 @@ String Cluster::Address::toFullString() const { return ((shard_index == 0) ? "" : "shard" + std::to_string(shard_index)) + - ((replica_index == 0) ? "" : "_replica" + std::to_string(replica_index)); + ((replica_index == 0) ? "" : "_replica" + std::to_string(replica_index)) + + ((secure == Protocol::Secure::Enable) ? "+secure" : ""); } Cluster::Address Cluster::Address::fromFullString(const String & full_string) diff --git a/dbms/src/Storages/Distributed/DirectoryMonitor.cpp b/dbms/src/Storages/Distributed/DirectoryMonitor.cpp index a9ebdb02076..77467da511e 100644 --- a/dbms/src/Storages/Distributed/DirectoryMonitor.cpp +++ b/dbms/src/Storages/Distributed/DirectoryMonitor.cpp @@ -190,10 +190,10 @@ ConnectionPoolPtr StorageDistributedDirectoryMonitor::createPool(const std::stri const auto & shards_info = cluster->getShardsInfo(); const auto & shards_addresses = cluster->getShardsAddresses(); - /// check format shard{shard_index}_number{number_index} + /// check new format shard{shard_index}_number{number_index} if (address.shard_index != 0) { - return shards_info[address.shard_index].per_replica_pools[address.replica_index]; + return shards_info[address.shard_index - 1].per_replica_pools[address.replica_index - 1]; } /// existing connections pool have a higher priority