envoyproxy/envoy

HDS should't initialize HdsCluster hosts as FAILED_ACTIVE_HC

Open

#5,408 建立於 2018年12月24日

在 GitHub 查看
 (5 留言) (0 反應) (0 負責人)C++ (5,373 fork)batch import
area/hdsenhancementhelp wanted

倉庫指標

Star
 (27,997 star)
PR 合併指標
 (平均合併 8天) (30 天內合併 378 個 PR)

描述

Title: HDS should't initialize HdsCluster hosts as FAILED_ACTIVE_HC

Description: HDS should't initialize HdsCluster hosts as FAILED_ACTIVE_HC, because when we may use hds as a heartbeat reporting channel with only endpoints and no health checks as follows:

cluster_health_checks {
  cluster_name: "user"
  locality_endpoints {
    endpoints {
      address {
        socket_address {
          address: "172.16.0.1"
          port_value: 8080
        }      
      }      
    }
  }
}
interval {
  seconds: 5
}

we should chanage the initializing as follows:

void HdsCluster::initialize(std::function<void()> callback) {
  initialization_complete_callback_ = callback;
  //for (const auto& host : *initial_hosts_) {
  //  host->healthFlagSet(Host::HealthFlag::FAILED_ACTIVE_HC);
  //}

  auto& first_host_set = priority_set_.getOrCreateHostSet(0);
  auto healthy = createHealthyHostList(*initial_hosts_);

  first_host_set.updateHosts(initial_hosts_, healthy, HostsPerLocalityImpl::empty(),
                             HostsPerLocalityImpl::empty(), {}, *initial_hosts_, {}, absl::nullopt);
}

related to issue: #1845

貢獻者指南