First choice of replica for given external dictionary should be based on randomness instead of order in configuration file.

const std::string & config_name_, const unsigned default_connections_,
                                   const unsigned max_connections_, const size_t max_tries_)
    : max_tries(max_tries_)
{
    shareable = config_.getBool(config_name_ + ".share_connection", false);
    if (config_.has(config_name_ + ".replica"))
    {
        Poco::Util::AbstractConfiguration::Keys replica_keys;
        config_.keys(config_name_, replica_keys);
        for (const auto & replica_config_key : replica_keys)
        {
            
            if (startsWith(replica_config_key, "replica"))
            {
                std::string replica_name = config_name_ + "." + replica_config_key;
                int priority = config_.getInt(replica_name + ".priority", 0);
                replicas_by_priority[priority].emplace_back(
                    std::make_shared<Pool>(config_, replica_name, default_connections_, max_connections_, config_name_.c_str()));
            }
        }
    }
    else
    {
        replicas_by_priority[0].emplace_back(
            std::make_shared<Pool>(config_, config_name_, default_connections_, max_connections_));
    }
}
PoolWithFailover::PoolWithFailover(const std::string & config_name_, const unsigned default_connections_,