Skip to content

Commit

Permalink
fix(meta): try resolve dns when activating node (#15808)
Browse files Browse the repository at this point in the history
  • Loading branch information
wenym1 authored Mar 20, 2024
1 parent 985ebf0 commit 6e6e72f
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/meta/service/src/cluster_service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,16 +48,6 @@ impl ClusterService for ClusterServiceImpl {
let req = request.into_inner();
let worker_type = req.get_worker_type()?;
let host: HostAddress = req.get_host()?.clone();
#[cfg(not(madsim))]
{
use risingwave_common::util::addr::try_resolve_dns;
use tracing::{error, info};
let socket_addr = try_resolve_dns(&host.host, host.port).await.map_err(|e| {
error!(e);
Status::internal(e)
})?;
info!(?socket_addr, ?host, "resolve host addr");
}
let property = req
.property
.ok_or_else(|| MetaError::invalid_parameter("worker node property is not provided"))?;
Expand Down Expand Up @@ -123,6 +113,16 @@ impl ClusterService for ClusterServiceImpl {
) -> Result<Response<ActivateWorkerNodeResponse>, Status> {
let req = request.into_inner();
let host = req.get_host()?.clone();
#[cfg(not(madsim))]
{
use risingwave_common::util::addr::try_resolve_dns;
use tracing::{error, info};
let socket_addr = try_resolve_dns(&host.host, host.port).await.map_err(|e| {
error!(e);
Status::internal(e)
})?;
info!(?socket_addr, ?host, "resolve host addr");
}
match &self.metadata_manager {
MetadataManager::V1(mgr) => mgr.cluster_manager.activate_worker_node(host).await?,
MetadataManager::V2(mgr) => {
Expand Down

0 comments on commit 6e6e72f

Please sign in to comment.