From 94edc9adeb80bfcf43cea9f5095237eec59f6d66 Mon Sep 17 00:00:00 2001 From: xhe Date: Mon, 21 Aug 2023 14:54:28 +0800 Subject: [PATCH] revert default port Signed-off-by: xhe --- components/playground/instance/tidb.go | 8 ++------ components/playground/instance/tiproxy.go | 2 +- components/playground/playground.go | 2 +- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/components/playground/instance/tidb.go b/components/playground/instance/tidb.go index 12dcbe821e..93acc95e24 100644 --- a/components/playground/instance/tidb.go +++ b/components/playground/instance/tidb.go @@ -34,13 +34,9 @@ type TiDBInstance struct { } // NewTiDBInstance return a TiDBInstance -func NewTiDBInstance(binPath string, dir, host, configPath string, id, port int, pds []*PDInstance, enableBinlog bool, isDisaggMode bool, tiproxys []*TiProxy) *TiDBInstance { +func NewTiDBInstance(binPath string, dir, host, configPath string, id, port int, pds []*PDInstance, enableBinlog bool, isDisaggMode bool) *TiDBInstance { if port <= 0 { - if len(tiproxys) > 0 { - port = 6000 - } else { - port = 4000 - } + port = 4000 } return &TiDBInstance{ instance: instance{ diff --git a/components/playground/instance/tiproxy.go b/components/playground/instance/tiproxy.go index 262cdfc55c..b39f5f01de 100644 --- a/components/playground/instance/tiproxy.go +++ b/components/playground/instance/tiproxy.go @@ -37,7 +37,7 @@ var _ Instance = &TiProxy{} // NewTiProxy create a TiProxy instance. func NewTiProxy(binPath string, dir, host, configPath string, id int, port int, pds []*PDInstance) *TiProxy { if port <= 0 { - port = 4000 + port = 6000 } tiproxy := &TiProxy{ instance: instance{ diff --git a/components/playground/playground.go b/components/playground/playground.go index 0fcd9b0d23..5401918c13 100644 --- a/components/playground/playground.go +++ b/components/playground/playground.go @@ -702,7 +702,7 @@ func (p *Playground) addInstance(componentID string, pdRole instance.PDRole, tif p.pds = append(p.pds, inst) } case spec.ComponentTiDB: - inst := instance.NewTiDBInstance(cfg.BinPath, dir, host, cfg.ConfigPath, id, cfg.Port, p.pds, p.enableBinlog(), p.bootOptions.Mode == "tidb-disagg", p.tiproxys) + inst := instance.NewTiDBInstance(cfg.BinPath, dir, host, cfg.ConfigPath, id, cfg.Port, p.pds, p.enableBinlog(), p.bootOptions.Mode == "tidb-disagg") ins = inst p.tidbs = append(p.tidbs, inst) case spec.ComponentTiKV: