From 41ef863e0d00254ffd5e1bebf0096b12c7a6d141 Mon Sep 17 00:00:00 2001 From: gmhdbjd Date: Mon, 21 Dec 2020 18:28:28 +0800 Subject: [PATCH] fix ci --- dm/worker/server.go | 2 ++ pkg/binlog/position.go | 7 ++++--- pkg/binlog/position_test.go | 4 ++-- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/dm/worker/server.go b/dm/worker/server.go index 909ddaad6f..c9153c63c7 100644 --- a/dm/worker/server.go +++ b/dm/worker/server.go @@ -560,6 +560,8 @@ func (s *Server) startWorker(cfg *config.SourceConfig) error { if err != nil { return err } + } else { + cfg.UUIDSuffix = binlog.MinUUIDSuffix } } diff --git a/pkg/binlog/position.go b/pkg/binlog/position.go index 0df9989dbc..6f302e1a59 100644 --- a/pkg/binlog/position.go +++ b/pkg/binlog/position.go @@ -36,7 +36,8 @@ const ( // eg. mysql-bin.000003 in c6ae5afe-c7a3-11e8-a19d-0242ac130006.000002 => mysql-bin|000002.000003 // where `000002` in `c6ae5afe-c7a3-11e8-a19d-0242ac130006.000002` is the UUIDSuffix posUUIDSuffixSeparator = "|" - minUUIDSuffix = 1 + // MinUUIDSuffix is same as relay.MinUUIDSuffix + MinUUIDSuffix = 1 ) var ( @@ -114,7 +115,7 @@ func RealMySQLPos(pos gmysql.Position) (gmysql.Position, error) { // ExtractSuffix extracts uuidSuffix from input name func ExtractSuffix(name string) (int, error) { if len(name) == 0 { - return minUUIDSuffix, nil + return MinUUIDSuffix, nil } filename, err := ParseFilename(name) if err != nil { @@ -126,7 +127,7 @@ func ExtractSuffix(name string) (int, error) { v, err := strconv.ParseInt(suffix, 10, 64) return int(v), err } - return minUUIDSuffix, nil + return MinUUIDSuffix, nil } // ExtractPos extracts (uuidWithSuffix, uuidSuffix, originalPos) from input pos (originalPos or convertedPos) diff --git a/pkg/binlog/position_test.go b/pkg/binlog/position_test.go index 197a3a6bf1..24d8526075 100644 --- a/pkg/binlog/position_test.go +++ b/pkg/binlog/position_test.go @@ -773,10 +773,10 @@ func (t *testPositionSuite) TestExtractSuffix(c *C) { }{ { "", - minUUIDSuffix, + MinUUIDSuffix, }, { "mysql-bin.00005", - minUUIDSuffix, + MinUUIDSuffix, }, { "mysql-bin|000001.000001",