Skip to content

Commit

Permalink
add log
Browse files Browse the repository at this point in the history
Signed-off-by: Ryan Leung <[email protected]>
  • Loading branch information
rleungx committed Sep 7, 2023
1 parent 30892d0 commit a2d01bd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion pkg/mcs/scheduling/server/grpc_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import (
"github.com/tikv/pd/pkg/core"
"github.com/tikv/pd/pkg/mcs/registry"
"github.com/tikv/pd/pkg/utils/apiutil"
"go.uber.org/zap"
"google.golang.org/grpc"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
Expand Down Expand Up @@ -72,11 +73,14 @@ func (s *Service) StoreHeartbeat(ctx context.Context, request *schedulingpb.Stor
c := s.GetCluster()
if c == nil {
// TODO: add metrics
log.Info("cluster isn't initialized")
return &schedulingpb.StoreHeartbeatResponse{Header: &schedulingpb.ResponseHeader{ClusterId: s.clusterID}}, nil
}

// TODO: add metrics
c.HandleStoreHeartbeat(request)
if err := c.HandleStoreHeartbeat(request); err != nil {
log.Error("handle store heartbeat failed", zap.Error(err))
}
return &schedulingpb.StoreHeartbeatResponse{Header: &schedulingpb.ResponseHeader{ClusterId: s.clusterID}}, nil
}

Expand All @@ -85,6 +89,7 @@ func (s *Service) PutStore(ctx context.Context, request *schedulingpb.PutStoreRe
c := s.GetCluster()
if c == nil {
// TODO: add metrics
log.Info("cluster isn't initialized")
return &schedulingpb.PutStoreResponse{Header: &schedulingpb.ResponseHeader{ClusterId: s.clusterID}}, nil
}

Expand Down
2 changes: 1 addition & 1 deletion tests/integrations/mcs/scheduling/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ func (suite *serverTestSuite) TestAllocIDAfterLeaderChange() {
re.NoError(failpoint.Disable("github.com/tikv/pd/pkg/mcs/scheduling/server/fastUpdateMember"))
}

func (suite *serverTestSuite) TestForwardSchedulingRelated() {
func (suite *serverTestSuite) TestForwardStoreHeartbeat() {
re := suite.Require()
tc, err := tests.NewTestSchedulingCluster(suite.ctx, 1, suite.backendEndpoints)
re.NoError(err)
Expand Down

0 comments on commit a2d01bd

Please sign in to comment.