Skip to content

Commit

Permalink
fix: add missing version for meta request
Browse files Browse the repository at this point in the history
  • Loading branch information
ShiKaiWi committed Oct 24, 2022
1 parent 09ee196 commit b774b1b
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 8 deletions.
6 changes: 3 additions & 3 deletions cluster/src/cluster_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,10 @@ impl ClusterImpl {

let handle = self.runtime.spawn(async move {
loop {
let shards_info = inner.shard_tables_cache.all_shard_infos();
info!("Node heartbeat to meta, shards info:{:?}", shards_info);
let shard_infos = inner.shard_tables_cache.all_shard_infos();
info!("Node heartbeat to meta, shard infos:{:?}", shard_infos);

let resp = inner.meta_client.send_heartbeat(shards_info).await;
let resp = inner.meta_client.send_heartbeat(shard_infos).await;
let wait = match resp {
Ok(()) => interval,
Err(e) => {
Expand Down
4 changes: 2 additions & 2 deletions meta_client/src/meta_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -219,10 +219,10 @@ impl MetaClient for MetaClientImpl {
GetNodesResponse::try_from(pb_resp)
}

async fn send_heartbeat(&self, shards_info: Vec<ShardInfo>) -> Result<()> {
async fn send_heartbeat(&self, shard_infos: Vec<ShardInfo>) -> Result<()> {
let node_info = NodeInfo {
node_meta_info: self.node_meta_info.clone(),
shards_info,
shard_infos,
};
let pb_req = meta_service::NodeHeartbeatRequest {
header: Some(self.request_header().into()),
Expand Down
6 changes: 3 additions & 3 deletions meta_client/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ impl NodeMetaInfo {
#[derive(Debug, Clone)]
pub struct NodeInfo {
pub node_meta_info: NodeMetaInfo,
pub shards_info: Vec<ShardInfo>,
pub shard_infos: Vec<ShardInfo>,
}

#[derive(Debug, Default, Clone, PartialEq, Eq)]
Expand Down Expand Up @@ -171,7 +171,7 @@ impl Default for MetaClientConfig {
impl From<NodeInfo> for meta_service::NodeInfo {
fn from(node_info: NodeInfo) -> Self {
let shard_infos = node_info
.shards_info
.shard_infos
.into_iter()
.map(meta_service::ShardInfo::from)
.collect();
Expand All @@ -193,7 +193,7 @@ impl From<ShardInfo> for meta_service::ShardInfo {
Self {
id: shard_info.id,
role: role as i32,
version: 0,
version: shard_info.version,
}
}
}
Expand Down
3 changes: 3 additions & 0 deletions server/src/grpc/meta_event_service/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ macro_rules! handle_request {
// considerations.

let request = request.into_inner();
info!("Receive request from meta, req:{:?}", request);

[<handle_ $mod_name>](ctx, request).await
});

Expand All @@ -80,6 +82,7 @@ macro_rules! handle_request {
}
};

info!("Finish handling request from meta, resp:{:?}", resp);
Ok(tonic::Response::new(resp))
}
}
Expand Down

0 comments on commit b774b1b

Please sign in to comment.