Skip to content

Commit

Permalink
grcp_server: return err if cluster id is not ready . (#5412) (#5426)
Browse files Browse the repository at this point in the history
close #5411, ref #5412

Signed-off-by: bufferflies <1045931706@qq.com>

Co-authored-by: bufferflies <1045931706@qq.com>
  • Loading branch information
ti-chi-bot and bufferflies authored Aug 11, 2022
1 parent e3d48eb commit db465fe
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions server/grpc_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -1500,6 +1500,9 @@ func (s *GrpcServer) validateRequest(header *pdpb.RequestHeader) error {
}

func (s *GrpcServer) header() *pdpb.ResponseHeader {
if s.clusterID == 0 {
return s.wrapErrorToHeader(pdpb.ErrorType_NOT_BOOTSTRAPPED, "cluster id is not ready")
}
return &pdpb.ResponseHeader{ClusterId: s.clusterID}
}

Expand Down

0 comments on commit db465fe

Please sign in to comment.