Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add missing version for meta request #339

Merged
merged 1 commit into from
Oct 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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