diff --git a/src/Storages/StorageDistributed.cpp b/src/Storages/StorageDistributed.cpp index f5b86d8f783f..761c152cb6da 100644 --- a/src/Storages/StorageDistributed.cpp +++ b/src/Storages/StorageDistributed.cpp @@ -1690,9 +1690,11 @@ Cluster::Addresses StorageDistributed::parseAddresses(const std::string & name) continue; } - if (address.replica_index > replicas) + if (address.replica_index == 0 || address.replica_index > replicas) { - LOG_ERROR(log, "No shard with replica_index={} ({})", address.replica_index, name); + LOG_ERROR(log, "Invalid replica_index={} for directory '{}' (cluster has {} replicas for shard {}). " + "Expected directory format: 'shardN_replicaM' or 'shardN_all_replicas'", + address.replica_index, dirname, replicas, address.shard_index); continue; }