diff --git a/src/meta/service/src/configs/outer_v0.rs b/src/meta/service/src/configs/outer_v0.rs index 68e61cba82ad..57eeb0bf047d 100644 --- a/src/meta/service/src/configs/outer_v0.rs +++ b/src/meta/service/src/configs/outer_v0.rs @@ -457,7 +457,7 @@ pub struct RaftConfig { #[clap(long, default_value_t = get_default_raft_advertise_host())] pub raft_advertise_host: String, - /// The listening port for metadata communication. + /// The listening port for raft communication. #[clap(long, default_value = "28004")] pub raft_api_port: u16, diff --git a/src/meta/service/src/meta_service/raft_service_impl.rs b/src/meta/service/src/meta_service/raft_service_impl.rs index fb229a393482..0a372e41e2f1 100644 --- a/src/meta/service/src/meta_service/raft_service_impl.rs +++ b/src/meta/service/src/meta_service/raft_service_impl.rs @@ -324,6 +324,7 @@ impl RaftService for RaftServiceImpl { request: Request, ) -> Result, Status> { let root = databend_common_tracing::start_trace_for_remote_request(full_name!(), &request); + let remote_addr = remote_addr(&request); async { self.incr_meta_metrics_recv_bytes_from_peer(&request); @@ -332,14 +333,20 @@ impl RaftService for RaftServiceImpl { let req_summary = ae_req.summary(); let raft = &self.meta_node.raft; - info!("RaftServiceImpl::append_entries: {}", req_summary); + info!( + "RaftServiceImpl::append_entries: from:{remote_addr} {}", + req_summary + ); let resp = raft .append_entries(ae_req) .await .map_err(GrpcHelper::internal_err)?; - info!("RaftServiceImpl::append_entries: done: {}", req_summary); + info!( + "RaftServiceImpl::append_entries: from:{remote_addr} done: {}", + req_summary + ); GrpcHelper::ok_response(&resp) } @@ -365,6 +372,7 @@ impl RaftService for RaftServiceImpl { async fn vote(&self, request: Request) -> Result, Status> { let root = databend_common_tracing::start_trace_for_remote_request(full_name!(), &request); + let remote_addr = remote_addr(&request); async { self.incr_meta_metrics_recv_bytes_from_peer(&request); @@ -373,13 +381,19 @@ impl RaftService for RaftServiceImpl { let v_req_summary = v_req.summary(); - info!("RaftServiceImpl::vote: start: {}", v_req_summary); + info!( + "RaftServiceImpl::vote: from:{remote_addr} start: {}", + v_req_summary + ); let raft = &self.meta_node.raft; let resp = raft.vote(v_req).await.map_err(GrpcHelper::internal_err)?; - info!("RaftServiceImpl::vote: done: {}", v_req_summary); + info!( + "RaftServiceImpl::vote: from:{remote_addr} done: {}", + v_req_summary + ); GrpcHelper::ok_response(&resp) } @@ -392,13 +406,19 @@ impl RaftService for RaftServiceImpl { request: Request, ) -> Result, Status> { let root = databend_common_tracing::start_trace_for_remote_request(full_name!(), &request); + let remote_addr = remote_addr(&request); + let fu = async { let req = request.into_inner(); let req: TransferLeaderRequest = req.try_into()?; let req_str = req.to_string(); - info!("RaftServiceImpl::{}: start: {}", func_name!(), req_str); + info!( + "RaftServiceImpl::{}: from:{remote_addr} start: {}", + func_name!(), + req_str + ); let raft = &self.meta_node.raft; @@ -406,7 +426,11 @@ impl RaftService for RaftServiceImpl { .await .map_err(GrpcHelper::internal_err)?; - info!("RaftServiceImpl::{}: done: {}", func_name!(), req_str); + info!( + "RaftServiceImpl::{}: from:{remote_addr} done: {}", + func_name!(), + req_str + ); Ok(Response::new(pb::Empty {})) };