Skip to content

Commit

Permalink
pd: handle get members with error (#452)
Browse files Browse the repository at this point in the history
  • Loading branch information
pingyu authored Jun 2, 2024
1 parent 0db723f commit 54fd720
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/pd/cluster.rs
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,19 @@ impl Connection {
.get_members(pdpb::GetMembersRequest::default())
.await?
.into_inner();
if let Some(err) = resp
.header
.as_ref()
.and_then(|header| header.error.as_ref())
{
return Err(internal_err!("failed to get PD members, err {:?}", err));
}
if resp.leader.is_none() {
return Err(internal_err!(
"unexpected no PD leader in get member resp: {:?}",
resp
));
}
Ok((client, keyspace_client, resp))
}

Expand Down

0 comments on commit 54fd720

Please sign in to comment.