**Use case**

Currently, `system.replicas` table has `total_replicas` and `active_replicas` columns which are useful to check/alert when some replicas are down. One problem, these columns are numbers. They tell when there is a problem, but you need to further check ZooKeeper or query all the nodes to detect what exact replicas (hosts) are down/inactive/have problems.

**Describe the solution you'd like**

Add a replicas column maybe as a map which would contain the replica name, and it's status. Or, add 2 array columns with `replica_names` and `active_replica_names`

**Alternative**

Something along the line

```sql
select path, value from system.zookeeper where path IN (
    select concat(path, '/', name) from system.zookeeper where path in (select concat(zookeeper_path, '/replicas') from system.replicas)
)
and name = 'is_active'
```
LOG_TRACE(log, "Found zookeper active replicas for part {}: {}", part.name, active_replicas.size());
    if (active_replicas.empty())
        return best_replica;
    /** You must select the best (most relevant) replica.
    * This is a replica with the maximum `log_pointer`, then with the minimum `queue` size.
    * NOTE This is not exactly the best criteria. It does not make sense to download old partitions,
    *  and it would be nice to be able to choose the replica closest by network.
    * NOTE Of course, there are data races here. You can solve it by retrying.
    */
    Int64 max_log_pointer = -1;
    UInt64 min_queue_size = std::numeric_limits<UInt64>::max();
    for (const String & replica : active_replicas)
    {
        String current_replica_path = fs::path(zookeeper_path) / "replicas" / replica;
        String log_pointer_str = zookeeper->get(fs::path(current_replica_path) / "log_pointer");
        Int64 log_pointer = log_pointer_str.empty() ? 0 : parse<UInt64>(log_pointer_str);
        Coordination::Stat stat;
        zookeeper->get(fs::path(current_replica_path) / "queue", &stat);
        size_t queue_size = stat.numChildren;
        if (log_pointer > max_log_pointer
            || (log_pointer == max_log_pointer && queue_size < min_queue_size))
        {
            max_log_pointer = log_pointer;
            min_queue_size = queue_size;
            best_replica = replica;
        }
    }
    return best_replica;
}
String StorageReplicatedMergeTree::findReplicaHavingPart(