From f57aa1daf54bf24cec85613d21c2d771bbf6a12b Mon Sep 17 00:00:00 2001 From: Ryan Leung Date: Wed, 8 Jan 2025 16:09:40 +0800 Subject: [PATCH] *: fix typo (#2487) Signed-off-by: Ryan Leung --- components/playground/instance/pd.go | 4 ++-- components/playground/playground.go | 2 +- pkg/cluster/api/pdapi.go | 8 ++++---- pkg/cluster/spec/scheduling.go | 2 +- pkg/cluster/spec/tso.go | 2 +- pkg/tidbver/tidbver.go | 8 ++++---- 6 files changed, 13 insertions(+), 13 deletions(-) diff --git a/components/playground/instance/pd.go b/components/playground/instance/pd.go index 8c699b990c..4ce7392904 100644 --- a/components/playground/instance/pd.go +++ b/components/playground/instance/pd.go @@ -150,7 +150,7 @@ func (inst *PDInstance) Start(ctx context.Context) error { fmt.Sprintf("--log-file=%s", inst.LogFile()), fmt.Sprintf("--config=%s", configPath), } - if tidbver.PDSupportMicroServicesWithName(inst.Version.String()) { + if tidbver.PDSupportMicroservicesWithName(inst.Version.String()) { args = append(args, fmt.Sprintf("--name=%s", uid)) } case PDRoleScheduling: @@ -164,7 +164,7 @@ func (inst *PDInstance) Start(ctx context.Context) error { fmt.Sprintf("--log-file=%s", inst.LogFile()), fmt.Sprintf("--config=%s", configPath), } - if tidbver.PDSupportMicroServicesWithName(inst.Version.String()) { + if tidbver.PDSupportMicroservicesWithName(inst.Version.String()) { args = append(args, fmt.Sprintf("--name=%s", uid)) } } diff --git a/components/playground/playground.go b/components/playground/playground.go index 1522626ef6..62d3401f55 100644 --- a/components/playground/playground.go +++ b/components/playground/playground.go @@ -1157,7 +1157,7 @@ func (p *Playground) bootCluster(ctx context.Context, env *environment.Environme instances..., ) } else if options.PDMode == "ms" { - if !tidbver.PDSupportMicroServices(options.Version) { + if !tidbver.PDSupportMicroservices(options.Version) { return fmt.Errorf("PD cluster doesn't support microservices mode in version %s", options.Version) } instances = append([]InstancePair{ diff --git a/pkg/cluster/api/pdapi.go b/pkg/cluster/api/pdapi.go index 3ac193a830..41983c2cf5 100644 --- a/pkg/cluster/api/pdapi.go +++ b/pkg/cluster/api/pdapi.go @@ -201,7 +201,7 @@ func (pc *PDClient) CheckHealth() error { return nil } -// CheckTSOHealth checks the health of TSO service(which is a Micro Service component of PD) +// CheckTSOHealth checks the health of TSO service(which is a microservice component of PD) func (pc *PDClient) CheckTSOHealth(retryOpt *utils.RetryOption) error { endpoints := pc.getEndpoints(tsoHealthPrefix) @@ -218,10 +218,10 @@ func (pc *PDClient) CheckTSOHealth(retryOpt *utils.RetryOption) error { } // return error by default, to make the retry work - pc.l().Debugf("Still waiting for the PD Micro Service's TSO health") - return perrs.New("Still waiting for the PD Micro Service's TSO health") + pc.l().Debugf("Still waiting for the PD microservice's TSO health") + return perrs.New("Still waiting for the PD microservice's TSO health") }, *retryOpt); err != nil { - return fmt.Errorf("error check PD Micro Service's TSO health, %v", err) + return fmt.Errorf("error check PD microservice's TSO health, %v", err) } return nil diff --git a/pkg/cluster/spec/scheduling.go b/pkg/cluster/spec/scheduling.go index 31957570d3..86c852a219 100644 --- a/pkg/cluster/spec/scheduling.go +++ b/pkg/cluster/spec/scheduling.go @@ -243,7 +243,7 @@ func (i *SchedulingInstance) InitConfig( LogDir: paths.Log, NumaNode: spec.NumaNode, } - if !tidbver.PDSupportMicroServicesWithName(version) { + if !tidbver.PDSupportMicroservicesWithName(version) { cfg.Name = "" } diff --git a/pkg/cluster/spec/tso.go b/pkg/cluster/spec/tso.go index 3b02f0630e..4cbf061e64 100644 --- a/pkg/cluster/spec/tso.go +++ b/pkg/cluster/spec/tso.go @@ -243,7 +243,7 @@ func (i *TSOInstance) InitConfig( LogDir: paths.Log, NumaNode: spec.NumaNode, } - if !tidbver.PDSupportMicroServicesWithName(version) { + if !tidbver.PDSupportMicroservicesWithName(version) { cfg.Name = "" } diff --git a/pkg/tidbver/tidbver.go b/pkg/tidbver/tidbver.go index c811510cfc..0f83e4ee27 100644 --- a/pkg/tidbver/tidbver.go +++ b/pkg/tidbver/tidbver.go @@ -99,13 +99,13 @@ func TiFlashPlaygroundNewStartMode(version string) bool { return semver.Compare(version, "v7.1.0") >= 0 || strings.Contains(version, "nightly") } -// PDSupportMicroServices returns true if the given version of PD supports micro services. -func PDSupportMicroServices(version string) bool { +// PDSupportMicroservices returns true if the given version of PD supports microservices. +func PDSupportMicroservices(version string) bool { return semver.Compare(version, "v7.3.0") >= 0 || strings.Contains(version, "nightly") } -// PDSupportMicroServicesWithName return if the given version of PD supports micro services with name. -func PDSupportMicroServicesWithName(version string) bool { +// PDSupportMicroservicesWithName return if the given version of PD supports microservices with name. +func PDSupportMicroservicesWithName(version string) bool { return semver.Compare(version, "v8.3.0") >= 0 || strings.Contains(version, "nightly") }