diff --git a/cmd/dm-worker/main.go b/cmd/dm-worker/main.go index 2ed5fec641..64500bf8c8 100644 --- a/cmd/dm-worker/main.go +++ b/cmd/dm-worker/main.go @@ -16,10 +16,12 @@ package main import ( "flag" "fmt" + "math/rand" "os" "os/signal" "strings" "syscall" + "time" "github.com/pingcap/dm/dm/worker" "github.com/pingcap/dm/pkg/log" @@ -30,6 +32,8 @@ import ( ) func main() { + rand.Seed(time.Now().UnixNano()) + cfg := worker.NewConfig() err := cfg.Parse(os.Args[1:]) switch errors.Cause(err) { diff --git a/dm/config/subtask.go b/dm/config/subtask.go index bb3a0a03cb..3995b84789 100644 --- a/dm/config/subtask.go +++ b/dm/config/subtask.go @@ -145,7 +145,7 @@ type SubTaskConfig struct { IgnoreCheckingItems []string `toml:"ignore-checking-items" json:"ignore-checking-items"` // it represents a MySQL/MariaDB instance or a replica group SourceID string `toml:"source-id" json:"source-id"` - ServerID int `toml:"server-id" json:"server-id"` + ServerID uint32 `toml:"server-id" json:"server-id"` Flavor string `toml:"flavor" json:"flavor"` MetaSchema string `toml:"meta-schema" json:"meta-schema"` RemoveMeta bool `toml:"remove-meta" json:"remove-meta"` diff --git a/dm/worker/config.go b/dm/worker/config.go index 404c183240..6a693dbdd9 100644 --- a/dm/worker/config.go +++ b/dm/worker/config.go @@ -16,11 +16,14 @@ package worker import ( "bytes" "context" + "database/sql" "encoding/base64" "encoding/json" "flag" "fmt" "io/ioutil" + "math" + "math/rand" "strings" "time" @@ -39,10 +42,13 @@ import ( ) const ( - // flavorReadTimeout is readTimeout for DB connection in adjustFlavor - flavorReadTimeout = "30s" - // flavorGetTimeout is timeout for getting version info from DB - flavorGetTimeout = 30 * time.Second + // dbReadTimeout is readTimeout for DB connection in adjust + dbReadTimeout = "30s" + // dbGetTimeout is timeout for getting some information from DB + dbGetTimeout = 30 * time.Second + + // the default base(min) server id generated by random + defaultBaseServerID = math.MaxUint32 / 10 ) // SampleConfigFile is sample config file of dm-worker @@ -50,7 +56,9 @@ const ( // and assign it to SampleConfigFile while we build dm-worker var SampleConfigFile string -var applyNewBaseDB = conn.DefaultDBProvider.Apply +var ( + getAllServerIDFunc = utils.GetAllServerID +) // NewConfig creates a new base config for worker. func NewConfig() *Config { @@ -94,7 +102,7 @@ type Config struct { AutoFixGTID bool `toml:"auto-fix-gtid" json:"auto-fix-gtid"` RelayDir string `toml:"relay-dir" json:"relay-dir"` MetaDir string `toml:"meta-dir" json:"meta-dir"` - ServerID int `toml:"server-id" json:"server-id"` + ServerID uint32 `toml:"server-id" json:"server-id"` Flavor string `toml:"flavor" json:"flavor"` Charset string `toml:"charset" json:"charset"` @@ -199,9 +207,7 @@ func (c *Config) Parse(arguments []string) error { // assign tracer id to source id c.Tracer.Source = c.SourceID - c.From.Adjust() - c.Checker.adjust() - err = c.adjustFlavor() + err = c.adjust() if err != nil { return err } @@ -256,8 +262,52 @@ func (c *Config) configFromFile(path string) error { return c.verify() } +func (c *Config) adjust() error { + c.From.Adjust() + c.Checker.adjust() + + if c.Flavor == "" || c.ServerID == 0 { + fromDB, err := c.createFromDB() + if err != nil { + return err + } + defer fromDB.Close() + + ctx, cancel := context.WithTimeout(context.Background(), dbGetTimeout) + defer cancel() + + err = c.adjustFlavor(ctx, fromDB.DB) + if err != nil { + return err + } + + err = c.adjustServerID(ctx, fromDB.DB) + if err != nil { + return err + } + } + + return nil +} + +func (c *Config) createFromDB() (*conn.BaseDB, error) { + // decrypt password + clone, err := c.DecryptPassword() + if err != nil { + return nil, err + } + from := clone.From + from.RawDBCfg = config.DefaultRawDBConfig().SetReadTimeout(dbReadTimeout) + fromDB, err := conn.DefaultDBProvider.Apply(from) + if err != nil { + return nil, terror.WithScope(err, terror.ScopeUpstream) + } + + return fromDB, nil +} + // adjustFlavor adjusts flavor through querying from given database -func (c *Config) adjustFlavor() error { +func (c *Config) adjustFlavor(ctx context.Context, db *sql.DB) (err error) { if c.Flavor != "" { switch c.Flavor { case mysql.MariaDBFlavor, mysql.MySQLFlavor: @@ -266,26 +316,39 @@ func (c *Config) adjustFlavor() error { return terror.ErrNotSupportedFlavor.Generate(c.Flavor) } } - // decrypt password - clone, err := c.DecryptPassword() - if err != nil { - return err + + c.Flavor, err = utils.GetFlavor(ctx, db) + if ctx.Err() != nil { + err = terror.Annotatef(err, "time cost to get flavor info exceeds %s", dbGetTimeout) + } + return terror.WithScope(err, terror.ScopeUpstream) +} + +func (c *Config) adjustServerID(ctx context.Context, db *sql.DB) error { + if c.ServerID != 0 { + return nil + } + + serverIDs, err := getAllServerIDFunc(ctx, db) + if ctx.Err() != nil { + err = terror.Annotatef(err, "time cost to get server-id info exceeds %s", dbGetTimeout) } - from := clone.From - from.RawDBCfg = config.DefaultRawDBConfig().SetReadTimeout(flavorReadTimeout) - fromDB, err := applyNewBaseDB(from) if err != nil { return terror.WithScope(err, terror.ScopeUpstream) } - defer fromDB.Close() - ctx, cancel := context.WithTimeout(context.Background(), flavorGetTimeout) - defer cancel() - c.Flavor, err = utils.GetFlavor(ctx, fromDB.DB) - if ctx.Err() != nil { - err = terror.Annotatef(err, "time cost to get flavor info exceeds %s", flavorGetTimeout) + for i := 0; i < 5; i++ { + randomValue := uint32(rand.Intn(100000)) + randomServerID := defaultBaseServerID + randomValue + if _, ok := serverIDs[randomServerID]; ok { + continue + } + + c.ServerID = randomServerID + return nil } - return terror.WithScope(err, terror.ScopeUpstream) + + return terror.ErrInvalidServerID.Generatef("can't find a random available server ID") } // UpdateConfigFile write configure to local file diff --git a/dm/worker/config_test.go b/dm/worker/config_test.go index ccbc0ed442..ee2f782ef7 100644 --- a/dm/worker/config_test.go +++ b/dm/worker/config_test.go @@ -14,17 +14,18 @@ package worker import ( + "context" + "database/sql" "fmt" "io/ioutil" "path" "strings" - "github.com/DATA-DOG/go-sqlmock" + sqlmock "github.com/DATA-DOG/go-sqlmock" . "github.com/pingcap/check" "github.com/siddontang/go-mysql/mysql" "github.com/pingcap/dm/dm/config" - "github.com/pingcap/dm/pkg/conn" ) func (t *testServer) TestConfig(c *C) { @@ -32,7 +33,7 @@ func (t *testServer) TestConfig(c *C) { c.Assert(cfg.Parse([]string{"-config=./dm-worker.toml", "-relay-dir=./xx"}), IsNil) c.Assert(cfg.RelayDir, Equals, "./xx") - c.Assert(cfg.ServerID, Equals, 101) + c.Assert(cfg.ServerID, Equals, uint32(101)) dir := c.MkDir() cfg.ConfigFile = path.Join(dir, "dm-worker.toml") @@ -41,7 +42,7 @@ func (t *testServer) TestConfig(c *C) { clone1 := cfg.Clone() c.Assert(cfg, DeepEquals, clone1) clone1.ServerID = 100 - c.Assert(cfg.ServerID, Equals, 101) + c.Assert(cfg.ServerID, Equals, uint32(101)) // test format c.Assert(cfg.String(), Matches, `.*"server-id":101.*`) @@ -55,10 +56,10 @@ func (t *testServer) TestConfig(c *C) { // test update config file and reload c.Assert(cfg.UpdateConfigFile(tomlStr), IsNil) c.Assert(cfg.Reload(), IsNil) - c.Assert(cfg.ServerID, Equals, 100) + c.Assert(cfg.ServerID, Equals, uint32(100)) c.Assert(cfg.UpdateConfigFile(originCfgStr), IsNil) c.Assert(cfg.Reload(), IsNil) - c.Assert(cfg.ServerID, Equals, 101) + c.Assert(cfg.ServerID, Equals, uint32(101)) // test decrypt password clone1.From.Password = "1234" @@ -170,10 +171,8 @@ func subtestFlavor(c *C, cfg *Config, sqlInfo, expectedFlavor, expectedError str WillReturnRows(sqlmock.NewRows([]string{"Variable_name", "Value"}). AddRow("version", sqlInfo)) mock.ExpectClose() - applyNewBaseDB = func(config config.DBConfig) (*conn.BaseDB, error) { - return &conn.BaseDB{DB: db}, nil - } - err = cfg.adjustFlavor() + + err = cfg.adjustFlavor(context.Background(), db) if expectedError == "" { c.Assert(err, IsNil) c.Assert(cfg.Flavor, Equals, expectedFlavor) @@ -187,18 +186,38 @@ func (t *testServer) TestAdjustFlavor(c *C) { c.Assert(cfg.Parse([]string{"-config=./dm-worker.toml", "-relay-dir=./xx"}), IsNil) cfg.Flavor = "mariadb" - err := cfg.adjustFlavor() + err := cfg.adjustFlavor(context.Background(), nil) c.Assert(err, IsNil) c.Assert(cfg.Flavor, Equals, mysql.MariaDBFlavor) cfg.Flavor = "MongoDB" - err = cfg.adjustFlavor() + err = cfg.adjustFlavor(context.Background(), nil) c.Assert(err, ErrorMatches, ".*flavor MongoDB not supported") - var origApplyNewBaseDB = applyNewBaseDB + subtestFlavor(c, cfg, "10.4.8-MariaDB-1:10.4.8+maria~bionic", mysql.MariaDBFlavor, "") + subtestFlavor(c, cfg, "5.7.26-log", mysql.MySQLFlavor, "") +} + +func (t *testServer) TestAdjustServerID(c *C) { + var originGetAllServerIDFunc = getAllServerIDFunc defer func() { - applyNewBaseDB = origApplyNewBaseDB + getAllServerIDFunc = originGetAllServerIDFunc }() + getAllServerIDFunc = getMockServerIDs - subtestFlavor(c, cfg, "10.4.8-MariaDB-1:10.4.8+maria~bionic", mysql.MariaDBFlavor, "") - subtestFlavor(c, cfg, "5.7.26-log", mysql.MySQLFlavor, "") + cfg := NewConfig() + c.Assert(cfg.Parse([]string{"-config=./dm-worker.toml", "-relay-dir=./xx"}), IsNil) + + cfg.adjustServerID(context.Background(), nil) + c.Assert(cfg.ServerID, Equals, uint32(101)) + + cfg.ServerID = 0 + cfg.adjustServerID(context.Background(), nil) + c.Assert(cfg.ServerID, Not(Equals), 0) +} + +func getMockServerIDs(ctx context.Context, db *sql.DB) (map[uint32]struct{}, error) { + return map[uint32]struct{}{ + 1: {}, + 2: {}, + }, nil } diff --git a/pkg/utils/db.go b/pkg/utils/db.go index 3f3b9ee7df..a27c25877c 100644 --- a/pkg/utils/db.go +++ b/pkg/utils/db.go @@ -52,6 +52,89 @@ func GetFlavor(ctx context.Context, db *sql.DB) (string, error) { return gmysql.MySQLFlavor, nil } +// GetAllServerID gets all slave server id and master server id +func GetAllServerID(ctx context.Context, db *sql.DB) (map[uint32]struct{}, error) { + serverIDs, err := GetSlaveServerID(ctx, db) + if err != nil { + return nil, err + } + + masterServerID, err := GetServerID(db) + if err != nil { + return nil, err + } + + serverIDs[masterServerID] = struct{}{} + return serverIDs, nil +} + +// GetSlaveServerID gets all slave server id +func GetSlaveServerID(ctx context.Context, db *sql.DB) (map[uint32]struct{}, error) { + rows, err := db.QueryContext(ctx, `SHOW SLAVE HOSTS`) + if err != nil { + return nil, terror.DBErrorAdapt(err, terror.ErrDBDriverError) + } + defer rows.Close() + + rowColumns, err := rows.Columns() + if err != nil { + return nil, terror.DBErrorAdapt(err, terror.ErrDBDriverError) + } + + /* + in MySQL: + mysql> SHOW SLAVE HOSTS; + +------------+-----------+------+-----------+--------------------------------------+ + | Server_id | Host | Port | Master_id | Slave_UUID | + +------------+-----------+------+-----------+--------------------------------------+ + | 192168010 | iconnect2 | 3306 | 192168011 | 14cb6624-7f93-11e0-b2c0-c80aa9429562 | + | 1921680101 | athena | 3306 | 192168011 | 07af4990-f41f-11df-a566-7ac56fdaf645 | + +------------+-----------+------+-----------+--------------------------------------+ + + in MariaDB: + mysql> SHOW SLAVE HOSTS; + +------------+-----------+------+-----------+ + | Server_id | Host | Port | Master_id | + +------------+-----------+------+-----------+ + | 192168010 | iconnect2 | 3306 | 192168011 | + | 1921680101 | athena | 3306 | 192168011 | + +------------+-----------+------+-----------+ + */ + + var ( + serverID sql.NullInt64 + host sql.NullString + port sql.NullInt64 + masterID sql.NullInt64 + slaveUUID sql.NullString + ) + serverIDs := make(map[uint32]struct{}) + for rows.Next() { + if len(rowColumns) == 5 { + err = rows.Scan(&serverID, &host, &port, &masterID, &slaveUUID) + } else { + err = rows.Scan(&serverID, &host, &port, &masterID) + } + if err != nil { + return nil, terror.DBErrorAdapt(err, terror.ErrDBDriverError) + } + + if serverID.Valid { + serverIDs[uint32(serverID.Int64)] = struct{}{} + } else { + // should never happened + log.L().Warn("get invalid server_id when execute `SHOW SLAVE HOSTS;`") + continue + } + } + + if rows.Err() != nil { + return nil, terror.DBErrorAdapt(rows.Err(), terror.ErrDBDriverError) + } + + return serverIDs, nil +} + // GetMasterStatus gets status from master func GetMasterStatus(db *sql.DB, flavor string) (gmysql.Position, gtid.Set, error) { var ( @@ -61,7 +144,7 @@ func GetMasterStatus(db *sql.DB, flavor string) (gmysql.Position, gtid.Set, erro rows, err := db.Query(`SHOW MASTER STATUS`) if err != nil { - return binlogPos, gs, err + return binlogPos, gs, terror.DBErrorAdapt(err, terror.ErrDBDriverError) } defer rows.Close() @@ -185,14 +268,14 @@ func GetGlobalVariable(db *sql.DB, variable string) (value string, err error) { } // GetServerID gets server's `server_id` -func GetServerID(db *sql.DB) (int64, error) { +func GetServerID(db *sql.DB) (uint32, error) { serverIDStr, err := GetGlobalVariable(db, "server_id") if err != nil { return 0, err } - serverID, err := strconv.ParseInt(serverIDStr, 10, 64) - return serverID, terror.ErrInvalidServerID.Delegate(err, serverIDStr) + serverID, err := strconv.ParseInt(serverIDStr, 10, 32) + return uint32(serverID), terror.ErrInvalidServerID.Delegate(err, serverIDStr) } // GetMariaDBGtidDomainID gets MariaDB server's `gtid_domain_id` diff --git a/pkg/utils/db_test.go b/pkg/utils/db_test.go new file mode 100644 index 0000000000..51fafc7b76 --- /dev/null +++ b/pkg/utils/db_test.go @@ -0,0 +1,88 @@ +// Copyright 2019 PingCAP, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// See the License for the specific language governing permissions and +// limitations under the License. + +package utils + +import ( + "context" + + "github.com/DATA-DOG/go-sqlmock" + . "github.com/pingcap/check" + "github.com/siddontang/go-mysql/mysql" +) + +func (t *testUtilsSuite) TestGetAllServerID(c *C) { + testCases := []struct { + masterID uint32 + serverIDs []uint32 + }{ + { + 1, + []uint32{2, 3, 4}, + }, { + 2, + []uint32{}, + }, + } + + db, mock, err := sqlmock.New() + c.Assert(err, IsNil) + + flavors := []string{mysql.MariaDBFlavor, mysql.MySQLFlavor} + + for _, testCase := range testCases { + for _, flavor := range flavors { + t.createMockResult(mock, testCase.masterID, testCase.serverIDs, flavor) + serverIDs, err := GetAllServerID(context.Background(), db) + c.Assert(err, IsNil) + + for _, serverID := range testCase.serverIDs { + _, ok := serverIDs[serverID] + c.Assert(ok, IsTrue) + } + + _, ok := serverIDs[testCase.masterID] + c.Assert(ok, IsTrue) + } + } + + err = mock.ExpectationsWereMet() + c.Assert(err, IsNil) +} + +func (t *testUtilsSuite) createMockResult(mock sqlmock.Sqlmock, masterID uint32, serverIDs []uint32, flavor string) { + expectQuery := mock.ExpectQuery("SHOW SLAVE HOSTS") + + host := "test" + port := 3306 + slaveUUID := "test" + + if flavor == mysql.MariaDBFlavor { + rows := sqlmock.NewRows([]string{"Server_id", "Host", "Port", "Master_id"}) + for _, serverID := range serverIDs { + rows.AddRow(serverID, host, port, masterID) + } + expectQuery.WillReturnRows(rows) + + } else { + rows := sqlmock.NewRows([]string{"Server_id", "Host", "Port", "Master_id", "Slave_UUID"}) + for _, serverID := range serverIDs { + rows.AddRow(serverID, host, port, masterID, slaveUUID) + } + expectQuery.WillReturnRows(rows) + } + + mock.ExpectQuery("SHOW GLOBAL VARIABLES LIKE 'server_id'").WillReturnRows(sqlmock.NewRows([]string{"Variable_name", "Value"}).AddRow("server_id", masterID)) + + return +} diff --git a/relay/config.go b/relay/config.go index 968230e04c..d982ba81fc 100644 --- a/relay/config.go +++ b/relay/config.go @@ -25,7 +25,7 @@ type Config struct { EnableGTID bool `toml:"enable-gtid" json:"enable-gtid"` AutoFixGTID bool `toml:"auto-fix-gtid" json:"auto-fix-gtid"` RelayDir string `toml:"relay-dir" json:"relay-dir"` - ServerID int `toml:"server-id" json:"server-id"` + ServerID uint32 `toml:"server-id" json:"server-id"` Flavor string `toml:"flavor" json:"flavor"` Charset string `toml:"charset" json:"charset"` From DBConfig `toml:"data-source" json:"data-source"` diff --git a/syncer/db_test.go b/syncer/db_test.go index 6e6ab7e042..008cb217f4 100644 --- a/syncer/db_test.go +++ b/syncer/db_test.go @@ -110,7 +110,7 @@ func (s *testDBSuite) TestGetServerUUID(c *C) { func (s *testDBSuite) TestGetServerID(c *C) { id, err := utils.GetServerID(s.db) c.Assert(err, IsNil) - c.Assert(id, Greater, int64(0)) + c.Assert(id, Greater, uint32(0)) } func (s *testDBSuite) TestBinaryLogs(c *C) { diff --git a/syncer/heartbeat.go b/syncer/heartbeat.go index 962f6ddbfa..36f6715497 100644 --- a/syncer/heartbeat.go +++ b/syncer/heartbeat.go @@ -51,7 +51,7 @@ type HeartbeatConfig struct { // serverID from dm-worker (relay) // now, heartbeat not be synced to downstream // so it will not be used by user directly and also enough to differ from other dm-worker's - serverID int + serverID uint32 masterCfg config.DBConfig // master server's DBConfig } @@ -196,8 +196,8 @@ func (h *Heartbeat) TryUpdateTaskTs(taskName, schema, table string, data [][]int h.logger.Warn("invalid data server_id for heartbeat", zap.Reflect("server ID", latest[1])) return } - if int(serverID) != h.cfg.serverID { - h.logger.Debug("ignore mismatched server_id for heartbeat", zap.Int32("obtained server ID", serverID), zap.Int("excepted server ID", h.cfg.serverID)) + if uint32(serverID) != h.cfg.serverID { + h.logger.Debug("ignore mismatched server_id for heartbeat", zap.Int32("obtained server ID", serverID), zap.Uint32("excepted server ID", h.cfg.serverID)) return // only ignore } @@ -295,7 +295,7 @@ func (h *Heartbeat) updateTS() error { // when we not need to support MySQL <=5.5, we can replace with `UTC_TIMESTAMP(6)` query := fmt.Sprintf("REPLACE INTO `%s`.`%s` (`ts`, `server_id`) VALUES(UTC_TIMESTAMP(), ?)", h.schema, h.table) _, err := h.master.Exec(query, h.cfg.serverID) - h.logger.Debug("update ts", zap.String("sql", query), zap.Int("server ID", h.cfg.serverID)) + h.logger.Debug("update ts", zap.String("sql", query), zap.Uint32("server ID", h.cfg.serverID)) return terror.WithScope(terror.DBErrorAdapt(err, terror.ErrDBDriverError), terror.ScopeUpstream) } diff --git a/syncer/online_ddl.go b/syncer/online_ddl.go index c5f93c4bf2..895035a9e3 100644 --- a/syncer/online_ddl.go +++ b/syncer/online_ddl.go @@ -100,7 +100,7 @@ func NewOnlineDDLStorage(newtctx *tcontext.Context, cfg *config.SubTaskConfig) * cfg: cfg, schema: cfg.MetaSchema, table: fmt.Sprintf("%s_onlineddl", cfg.Name), - id: strconv.Itoa(cfg.ServerID), + id: strconv.FormatUint(uint64(cfg.ServerID), 10), ddls: make(map[string]map[string]*GhostDDLInfo), tctx: newtctx, } diff --git a/syncer/syncer.go b/syncer/syncer.go index 1ac8438a31..f820fa33c7 100644 --- a/syncer/syncer.go +++ b/syncer/syncer.go @@ -2396,7 +2396,7 @@ func (s *Syncer) checkpointID() string { if len(s.cfg.SourceID) > 0 { return s.cfg.SourceID } - return strconv.Itoa(s.cfg.ServerID) + return strconv.FormatUint(uint64(s.cfg.ServerID), 10) } // DDLInfo returns a chan from which can receive DDLInfo diff --git a/tests/all_mode/conf/dm-worker1.toml b/tests/all_mode/conf/dm-worker1.toml index f43c88f0b1..621d4ceabd 100644 --- a/tests/all_mode/conf/dm-worker1.toml +++ b/tests/all_mode/conf/dm-worker1.toml @@ -1,6 +1,5 @@ # Worker Configuration. -server-id = 101 source-id = "mysql-replica-01" flavor = "" enable-gtid = false diff --git a/tests/all_mode/conf/dm-worker2.toml b/tests/all_mode/conf/dm-worker2.toml index 438c149d9e..f53b7df453 100644 --- a/tests/all_mode/conf/dm-worker2.toml +++ b/tests/all_mode/conf/dm-worker2.toml @@ -1,6 +1,5 @@ # Worker Configuration. -server-id = 102 source-id = "mysql-replica-02" flavor = "" enable-gtid = false diff --git a/tests/compatibility/conf/dm-worker1.toml b/tests/compatibility/conf/dm-worker1.toml index 0657e62c30..1cb2c0a256 100644 --- a/tests/compatibility/conf/dm-worker1.toml +++ b/tests/compatibility/conf/dm-worker1.toml @@ -1,6 +1,5 @@ # Worker Configuration. -server-id = 101 source-id = "mysql-replica-01" flavor = "" enable-gtid = false diff --git a/tests/compatibility/conf/dm-worker2.toml b/tests/compatibility/conf/dm-worker2.toml index 115a17459d..b1d74402eb 100644 --- a/tests/compatibility/conf/dm-worker2.toml +++ b/tests/compatibility/conf/dm-worker2.toml @@ -1,6 +1,5 @@ # Worker Configuration. -server-id = 102 source-id = "mysql-replica-02" flavor = "" enable-gtid = false diff --git a/tests/dmctl_basic/conf/dm-worker1.toml b/tests/dmctl_basic/conf/dm-worker1.toml index 0657e62c30..1cb2c0a256 100644 --- a/tests/dmctl_basic/conf/dm-worker1.toml +++ b/tests/dmctl_basic/conf/dm-worker1.toml @@ -1,6 +1,5 @@ # Worker Configuration. -server-id = 101 source-id = "mysql-replica-01" flavor = "" enable-gtid = false diff --git a/tests/dmctl_basic/conf/dm-worker2.toml b/tests/dmctl_basic/conf/dm-worker2.toml index 115a17459d..b1d74402eb 100644 --- a/tests/dmctl_basic/conf/dm-worker2.toml +++ b/tests/dmctl_basic/conf/dm-worker2.toml @@ -1,6 +1,5 @@ # Worker Configuration. -server-id = 102 source-id = "mysql-replica-02" flavor = "" enable-gtid = false diff --git a/tests/http_apis/conf/dm-worker1.toml b/tests/http_apis/conf/dm-worker1.toml index 0657e62c30..1cb2c0a256 100644 --- a/tests/http_apis/conf/dm-worker1.toml +++ b/tests/http_apis/conf/dm-worker1.toml @@ -1,6 +1,5 @@ # Worker Configuration. -server-id = 101 source-id = "mysql-replica-01" flavor = "" enable-gtid = false diff --git a/tests/incremental_mode/conf/dm-worker1.toml b/tests/incremental_mode/conf/dm-worker1.toml index 0657e62c30..1cb2c0a256 100644 --- a/tests/incremental_mode/conf/dm-worker1.toml +++ b/tests/incremental_mode/conf/dm-worker1.toml @@ -1,6 +1,5 @@ # Worker Configuration. -server-id = 101 source-id = "mysql-replica-01" flavor = "" enable-gtid = false diff --git a/tests/incremental_mode/conf/dm-worker2.toml b/tests/incremental_mode/conf/dm-worker2.toml index 115a17459d..b1d74402eb 100644 --- a/tests/incremental_mode/conf/dm-worker2.toml +++ b/tests/incremental_mode/conf/dm-worker2.toml @@ -1,6 +1,5 @@ # Worker Configuration. -server-id = 102 source-id = "mysql-replica-02" flavor = "" enable-gtid = false diff --git a/tests/initial_unit/conf/dm-worker1.toml b/tests/initial_unit/conf/dm-worker1.toml index 61bbb8ee31..a60a02c2f4 100644 --- a/tests/initial_unit/conf/dm-worker1.toml +++ b/tests/initial_unit/conf/dm-worker1.toml @@ -1,6 +1,5 @@ # Worker Configuration. -server-id = 101 source-id = "mysql-replica-01" flavor = "" enable-gtid = false diff --git a/tests/load_interrupt/conf/dm-worker1.toml b/tests/load_interrupt/conf/dm-worker1.toml index 0657e62c30..1cb2c0a256 100644 --- a/tests/load_interrupt/conf/dm-worker1.toml +++ b/tests/load_interrupt/conf/dm-worker1.toml @@ -1,6 +1,5 @@ # Worker Configuration. -server-id = 101 source-id = "mysql-replica-01" flavor = "" enable-gtid = false diff --git a/tests/load_interrupt/conf/dm-worker2.toml b/tests/load_interrupt/conf/dm-worker2.toml index 115a17459d..b1d74402eb 100644 --- a/tests/load_interrupt/conf/dm-worker2.toml +++ b/tests/load_interrupt/conf/dm-worker2.toml @@ -1,6 +1,5 @@ # Worker Configuration. -server-id = 102 source-id = "mysql-replica-02" flavor = "" enable-gtid = false diff --git a/tests/online_ddl/conf/dm-worker1.toml b/tests/online_ddl/conf/dm-worker1.toml index 0657e62c30..1cb2c0a256 100644 --- a/tests/online_ddl/conf/dm-worker1.toml +++ b/tests/online_ddl/conf/dm-worker1.toml @@ -1,6 +1,5 @@ # Worker Configuration. -server-id = 101 source-id = "mysql-replica-01" flavor = "" enable-gtid = false diff --git a/tests/online_ddl/conf/dm-worker2.toml b/tests/online_ddl/conf/dm-worker2.toml index 115a17459d..b1d74402eb 100644 --- a/tests/online_ddl/conf/dm-worker2.toml +++ b/tests/online_ddl/conf/dm-worker2.toml @@ -1,6 +1,5 @@ # Worker Configuration. -server-id = 102 source-id = "mysql-replica-02" flavor = "" enable-gtid = false diff --git a/tests/print_status/conf/dm-worker1.toml b/tests/print_status/conf/dm-worker1.toml index 0657e62c30..1cb2c0a256 100644 --- a/tests/print_status/conf/dm-worker1.toml +++ b/tests/print_status/conf/dm-worker1.toml @@ -1,6 +1,5 @@ # Worker Configuration. -server-id = 101 source-id = "mysql-replica-01" flavor = "" enable-gtid = false diff --git a/tests/relay_interrupt/conf/dm-worker1.toml b/tests/relay_interrupt/conf/dm-worker1.toml index 0657e62c30..1cb2c0a256 100644 --- a/tests/relay_interrupt/conf/dm-worker1.toml +++ b/tests/relay_interrupt/conf/dm-worker1.toml @@ -1,6 +1,5 @@ # Worker Configuration. -server-id = 101 source-id = "mysql-replica-01" flavor = "" enable-gtid = false diff --git a/tests/safe_mode/conf/dm-worker1.toml b/tests/safe_mode/conf/dm-worker1.toml index 423e65ea43..128a01fcdc 100644 --- a/tests/safe_mode/conf/dm-worker1.toml +++ b/tests/safe_mode/conf/dm-worker1.toml @@ -1,6 +1,5 @@ # Worker Configuration. -server-id = 101 source-id = "mysql-replica-01" flavor = "" enable-gtid = false diff --git a/tests/safe_mode/conf/dm-worker2.toml b/tests/safe_mode/conf/dm-worker2.toml index 2ead050b79..7a17a62644 100644 --- a/tests/safe_mode/conf/dm-worker2.toml +++ b/tests/safe_mode/conf/dm-worker2.toml @@ -1,6 +1,5 @@ # Worker Configuration. -server-id = 102 source-id = "mysql-replica-02" flavor = "" enable-gtid = false diff --git a/tests/sequence_safe_mode/conf/dm-worker1.toml b/tests/sequence_safe_mode/conf/dm-worker1.toml index 423e65ea43..128a01fcdc 100644 --- a/tests/sequence_safe_mode/conf/dm-worker1.toml +++ b/tests/sequence_safe_mode/conf/dm-worker1.toml @@ -1,6 +1,5 @@ # Worker Configuration. -server-id = 101 source-id = "mysql-replica-01" flavor = "" enable-gtid = false diff --git a/tests/sequence_safe_mode/conf/dm-worker2.toml b/tests/sequence_safe_mode/conf/dm-worker2.toml index 2ead050b79..7a17a62644 100644 --- a/tests/sequence_safe_mode/conf/dm-worker2.toml +++ b/tests/sequence_safe_mode/conf/dm-worker2.toml @@ -1,6 +1,5 @@ # Worker Configuration. -server-id = 102 source-id = "mysql-replica-02" flavor = "" enable-gtid = false diff --git a/tests/sequence_sharding/conf/dm-worker1.toml b/tests/sequence_sharding/conf/dm-worker1.toml index 0657e62c30..1cb2c0a256 100644 --- a/tests/sequence_sharding/conf/dm-worker1.toml +++ b/tests/sequence_sharding/conf/dm-worker1.toml @@ -1,6 +1,5 @@ # Worker Configuration. -server-id = 101 source-id = "mysql-replica-01" flavor = "" enable-gtid = false diff --git a/tests/sequence_sharding/conf/dm-worker2.toml b/tests/sequence_sharding/conf/dm-worker2.toml index 115a17459d..b1d74402eb 100644 --- a/tests/sequence_sharding/conf/dm-worker2.toml +++ b/tests/sequence_sharding/conf/dm-worker2.toml @@ -1,6 +1,5 @@ # Worker Configuration. -server-id = 102 source-id = "mysql-replica-02" flavor = "" enable-gtid = false diff --git a/tests/sharding/conf/dm-worker1.toml b/tests/sharding/conf/dm-worker1.toml index 0657e62c30..1cb2c0a256 100644 --- a/tests/sharding/conf/dm-worker1.toml +++ b/tests/sharding/conf/dm-worker1.toml @@ -1,6 +1,5 @@ # Worker Configuration. -server-id = 101 source-id = "mysql-replica-01" flavor = "" enable-gtid = false diff --git a/tests/sharding/conf/dm-worker2.toml b/tests/sharding/conf/dm-worker2.toml index 115a17459d..b1d74402eb 100644 --- a/tests/sharding/conf/dm-worker2.toml +++ b/tests/sharding/conf/dm-worker2.toml @@ -1,6 +1,5 @@ # Worker Configuration. -server-id = 102 source-id = "mysql-replica-02" flavor = "" enable-gtid = false diff --git a/tests/start_task/conf/dm-worker1.toml b/tests/start_task/conf/dm-worker1.toml index 0657e62c30..1cb2c0a256 100644 --- a/tests/start_task/conf/dm-worker1.toml +++ b/tests/start_task/conf/dm-worker1.toml @@ -1,6 +1,5 @@ # Worker Configuration. -server-id = 101 source-id = "mysql-replica-01" flavor = "" enable-gtid = false