Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
Signed-off-by: Ryan Leung <[email protected]>
  • Loading branch information
rleungx committed Jan 6, 2025
1 parent f1f9d7f commit 2ca7c6b
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions pkg/mcs/scheduling/server/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -257,8 +257,8 @@ func (c *Cluster) triggerMembershipCheck() {
}
}

// SwitchPDLeader switches the PD service leader.
func (c *Cluster) SwitchPDLeader(new pdpb.PDClient) bool {
// SwitchPDServiceLeader switches the PD service leader.
func (c *Cluster) SwitchPDServiceLeader(new pdpb.PDClient) bool {
old := c.pdLeader.Load()
return c.pdLeader.CompareAndSwap(old, new)
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/mcs/scheduling/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ func (s *Server) updatePDServiceMemberLoop() {
// double check
break
}
if s.cluster.SwitchPDLeader(pdpb.NewPDClient(cc)) {
if s.cluster.SwitchPDServiceLeader(pdpb.NewPDClient(cc)) {
if status.Leader != curLeader {
log.Info("switch leader", zap.String("leader-id", fmt.Sprintf("%x", ep.ID)), zap.String("endpoint", ep.ClientURLs[0]))
}
Expand Down
2 changes: 1 addition & 1 deletion tools/pd-ctl/pdctl/command/config_command.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ const (
pdServerPrefix = "pd/api/v1/config/pd-server"
serviceMiddlewareConfigPrefix = "pd/api/v1/service-middleware/config"
// flagFromPDService has no influence for pd mode, but it is useful for us to debug in pd service mode.
flagFromPDService = "from_api_server"
flagFromPDService = "from_pd_service"
)

// NewConfigCommand return a config subcommand of rootCmd
Expand Down
4 changes: 2 additions & 2 deletions tools/pd-ctl/tests/config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ func (suite *configTestSuite) checkConfigForwardControl(cluster *pdTests.TestClu
args := []string{"-u", pdAddr, "config", "show"}
args = append(args, options...)
if isFromPDService {
args = append(args, "--from_api_server")
args = append(args, "--from_pd_service")
}
output, err := tests.ExecuteCommand(cmd, args...)
re.NoError(err)
Expand Down Expand Up @@ -478,7 +478,7 @@ func (suite *configTestSuite) checkConfigForwardControl(cluster *pdTests.TestClu
args := []string{"-u", pdAddr, "config", "placement-rules"}
args = append(args, options...)
if isFromPDService {
args = append(args, "--from_api_server")
args = append(args, "--from_pd_service")
}
output, err := tests.ExecuteCommand(cmd, args...)
re.NoError(err)
Expand Down

0 comments on commit 2ca7c6b

Please sign in to comment.