From 6eaa43525ee1dd681a97d0e57bfc659694d011d0 Mon Sep 17 00:00:00 2001 From: luancheng Date: Tue, 3 Mar 2020 16:56:45 +0800 Subject: [PATCH 1/8] *: update tidb dependency build with go1.14 --- go.mod | 4 ++-- go.sum | 14 ++++++++------ pkg/restore/util.go | 4 ++++ 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/go.mod b/go.mod index 6720e3602..d61f014a9 100644 --- a/go.mod +++ b/go.mod @@ -20,11 +20,11 @@ require ( github.com/onsi/gomega v1.8.1 // indirect github.com/pingcap/check v0.0.0-20200212061837-5e12011dc712 github.com/pingcap/errors v0.11.5-0.20190809092503-95897b64e011 - github.com/pingcap/kvproto v0.0.0-20200217103621-528e82bf7248 + github.com/pingcap/kvproto v0.0.0-20200221125103-35b65c96516e github.com/pingcap/log v0.0.0-20200117041106-d28c14d3b1cd github.com/pingcap/parser v0.0.0-20200218113622-517beb2e39c2 github.com/pingcap/pd v1.1.0-beta.0.20200106144140-f5a7aa985497 - github.com/pingcap/tidb v1.1.0-beta.0.20200223044457-aedea3ec5e1e + github.com/pingcap/tidb v1.1.0-beta.0.20200303080309-9ae471c0eea8 github.com/pingcap/tidb-tools v4.0.0-beta+incompatible github.com/pingcap/tipb v0.0.0-20200212061130-c4d518eb1d60 github.com/prometheus/client_golang v1.0.0 diff --git a/go.sum b/go.sum index ca889933a..b02bcf90e 100644 --- a/go.sum +++ b/go.sum @@ -307,8 +307,8 @@ github.com/pingcap/goleveldb v0.0.0-20191226122134-f82aafb29989 h1:surzm05a8C9dN github.com/pingcap/goleveldb v0.0.0-20191226122134-f82aafb29989/go.mod h1:O17XtbryoCJhkKGbT62+L2OlrniwqiGLSqrmdHCMzZw= github.com/pingcap/kvproto v0.0.0-20191211054548-3c6b38ea5107/go.mod h1:WWLmULLO7l8IOcQG+t+ItJ3fEcrL5FxF0Wu+HrMy26w= github.com/pingcap/kvproto v0.0.0-20191213111810-93cb7c623c8b/go.mod h1:WWLmULLO7l8IOcQG+t+ItJ3fEcrL5FxF0Wu+HrMy26w= -github.com/pingcap/kvproto v0.0.0-20200217103621-528e82bf7248 h1:DhGKu4ACa5v0Z70J1NWrc9ti+OqihhxmyzsK7YDTpVQ= -github.com/pingcap/kvproto v0.0.0-20200217103621-528e82bf7248/go.mod h1:IOdRDPLyda8GX2hE/jO7gqaCV/PNFh8BZQCQZXfIOqI= +github.com/pingcap/kvproto v0.0.0-20200221125103-35b65c96516e h1:z7j9uyuG/6I4god5h5NbsbMDSfhoOYAvVW6JxhwdHHw= +github.com/pingcap/kvproto v0.0.0-20200221125103-35b65c96516e/go.mod h1:IOdRDPLyda8GX2hE/jO7gqaCV/PNFh8BZQCQZXfIOqI= github.com/pingcap/log v0.0.0-20191012051959-b742a5d432e9 h1:AJD9pZYm72vMgPcQDww9rkZ1DnWfl0pXV3BOWlkYIjA= github.com/pingcap/log v0.0.0-20191012051959-b742a5d432e9/go.mod h1:4rbK1p9ILyIfb6hU7OG2CiWSqMXnp3JMbiaVJ6mvoY8= github.com/pingcap/log v0.0.0-20200117041106-d28c14d3b1cd h1:CV3VsP3Z02MVtdpTMfEgRJ4T9NGgGTxdHpJerent7rM= @@ -321,8 +321,8 @@ github.com/pingcap/sysutil v0.0.0-20191216090214-5f9620d22b3b h1:EEyo/SCRswLGuSk github.com/pingcap/sysutil v0.0.0-20191216090214-5f9620d22b3b/go.mod h1:EB/852NMQ+aRKioCpToQ94Wl7fktV+FNnxf3CX/TTXI= github.com/pingcap/sysutil v0.0.0-20200206130906-2bfa6dc40bcd h1:k7CIHMFVKjHsda3PKkiN4zv++NEnexlUwiJEhryWpG0= github.com/pingcap/sysutil v0.0.0-20200206130906-2bfa6dc40bcd/go.mod h1:EB/852NMQ+aRKioCpToQ94Wl7fktV+FNnxf3CX/TTXI= -github.com/pingcap/tidb v1.1.0-beta.0.20200223044457-aedea3ec5e1e h1:HPSJdnkI6mt0qEIbSkJzVsq99929Ki5VblkJMmlqhI0= -github.com/pingcap/tidb v1.1.0-beta.0.20200223044457-aedea3ec5e1e/go.mod h1:zzO/kysmwHMkr0caH2NmuSAKLdsySXKDQGTCYrb7Gx8= +github.com/pingcap/tidb v1.1.0-beta.0.20200303080309-9ae471c0eea8 h1:YgPH0M0t0lE+vIKEXhKNSAQi822wKRIW7+RhcwVFCKw= +github.com/pingcap/tidb v1.1.0-beta.0.20200303080309-9ae471c0eea8/go.mod h1:untj2MAKBepgebXTYWRsEW54UvngfHxn2zUy6gp8ITo= github.com/pingcap/tidb-tools v3.0.6-0.20191106033616-90632dda3863+incompatible h1:H1jg0aDWz2SLRh3hNBo2HFtnuHtudIUvBumU7syRkic= github.com/pingcap/tidb-tools v3.0.6-0.20191106033616-90632dda3863+incompatible/go.mod h1:XGdcy9+yqlDSEMTpOXnwf3hiTeqrV6MN/u1se9N8yIM= github.com/pingcap/tidb-tools v4.0.0-beta+incompatible h1:+XJdcVLCM8GDgXiMS6lFV59N3XPVOqtNHeWNLVrb2pg= @@ -570,9 +570,9 @@ golang.org/x/tools v0.0.0-20191107010934-f79515f33823 h1:akkRBeitX2EZP59KdtKw310 golang.org/x/tools v0.0.0-20191107010934-f79515f33823/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2 h1:EtTFh6h4SAKemS+CURDMTDIANuduG5zKEXShyy18bGA= golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200206050830-dd0d5d485177 h1:E2vxBajJgSA3TcJhDGTh/kP3VnsvXKl9jSijv+h7svQ= -golang.org/x/tools v0.0.0-20200206050830-dd0d5d485177/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200216192241-b320d3a0f5a2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200226224502-204d844ad48d h1:loGv/4fxITSrCD4t2P8ZF4oUC4RlRFDAsczcoUS2g6c= golang.org/x/tools v0.0.0-20200226224502-204d844ad48d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -644,6 +644,8 @@ honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.1-2019.2.3 h1:3JgtbtFHMiCmsznwGVTUWbgGov+pVqnlf1dEJTNAXeM= honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= +honnef.co/go/tools v0.0.1-2020.1.3 h1:sXmLre5bzIR6ypkjXCDI3jHPssRhc8KD/Ome589sc3U= +honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= sigs.k8s.io/yaml v1.1.0 h1:4A07+ZFc2wgJwo8YNlQpr1rVlgUDlxXHhPJciaPY5gs= sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= diff --git a/pkg/restore/util.go b/pkg/restore/util.go index 7b70c9806..c2fece974 100644 --- a/pkg/restore/util.go +++ b/pkg/restore/util.go @@ -36,6 +36,10 @@ func (alloc *idAllocator) Alloc(tableID int64, n uint64, increment, offset int64 return alloc.id, alloc.id, nil } +func (alloc *idAllocator) AllocSeqCache(sequenceID int64) (min int64, max int64, round int64, err error) { + return 0, 0, 0, nil +} + func (alloc *idAllocator) Rebase(tableID, newBase int64, allocIDs bool) error { return nil } From c6121ba0712308918e363dbe0e4215c7bcdd69bb Mon Sep 17 00:00:00 2001 From: luancheng Date: Tue, 3 Mar 2020 20:06:12 +0800 Subject: [PATCH 2/8] fix test --- pkg/storage/parse_test.go | 2 +- pkg/storage/s3_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/storage/parse_test.go b/pkg/storage/parse_test.go index d72b8a5b3..c5a53fbb0 100644 --- a/pkg/storage/parse_test.go +++ b/pkg/storage/parse_test.go @@ -19,7 +19,7 @@ var _ = Suite(&testStorageSuite{}) func (r *testStorageSuite) TestCreateStorage(c *C) { _, err := ParseBackend("1invalid:", nil) - c.Assert(err, ErrorMatches, "parse 1invalid:: first path segment in URL cannot contain colon") + c.Assert(err, ErrorMatches, "parse (.*)1invalid:(.*): first path segment in URL cannot contain colon") _, err = ParseBackend("net:storage", nil) c.Assert(err, ErrorMatches, "storage net not support yet") diff --git a/pkg/storage/s3_test.go b/pkg/storage/s3_test.go index 3eaf1c206..f1bb415a6 100644 --- a/pkg/storage/s3_test.go +++ b/pkg/storage/s3_test.go @@ -72,7 +72,7 @@ func (r *testStorageSuite) TestApply(c *C) { options: S3BackendOptions{ Endpoint: "!http:12345", }, - errMsg: "parse !http:12345: first path segment in URL cannot contain colon", + errMsg: "parse (.*)!http:12345(.*): first path segment in URL cannot contain colon", errReturn: true, }, } From de42cbe8aa601e4a08c5e285a4ec9c9451d84b16 Mon Sep 17 00:00:00 2001 From: luancheng Date: Tue, 3 Mar 2020 20:06:12 +0800 Subject: [PATCH 3/8] fix test --- pkg/restore/util.go | 1 + pkg/storage/parse_test.go | 2 +- pkg/storage/s3_test.go | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/pkg/restore/util.go b/pkg/restore/util.go index c2fece974..6490f372a 100644 --- a/pkg/restore/util.go +++ b/pkg/restore/util.go @@ -37,6 +37,7 @@ func (alloc *idAllocator) Alloc(tableID int64, n uint64, increment, offset int64 } func (alloc *idAllocator) AllocSeqCache(sequenceID int64) (min int64, max int64, round int64, err error) { + // TODO fix this function after support backup sequence return 0, 0, 0, nil } diff --git a/pkg/storage/parse_test.go b/pkg/storage/parse_test.go index d72b8a5b3..c5a53fbb0 100644 --- a/pkg/storage/parse_test.go +++ b/pkg/storage/parse_test.go @@ -19,7 +19,7 @@ var _ = Suite(&testStorageSuite{}) func (r *testStorageSuite) TestCreateStorage(c *C) { _, err := ParseBackend("1invalid:", nil) - c.Assert(err, ErrorMatches, "parse 1invalid:: first path segment in URL cannot contain colon") + c.Assert(err, ErrorMatches, "parse (.*)1invalid:(.*): first path segment in URL cannot contain colon") _, err = ParseBackend("net:storage", nil) c.Assert(err, ErrorMatches, "storage net not support yet") diff --git a/pkg/storage/s3_test.go b/pkg/storage/s3_test.go index 3eaf1c206..f1bb415a6 100644 --- a/pkg/storage/s3_test.go +++ b/pkg/storage/s3_test.go @@ -72,7 +72,7 @@ func (r *testStorageSuite) TestApply(c *C) { options: S3BackendOptions{ Endpoint: "!http:12345", }, - errMsg: "parse !http:12345: first path segment in URL cannot contain colon", + errMsg: "parse (.*)!http:12345(.*): first path segment in URL cannot contain colon", errReturn: true, }, } From 11e2e59c9d6db644a78b15a50050857330dc5566 Mon Sep 17 00:00:00 2001 From: luancheng Date: Thu, 5 Mar 2020 19:39:18 +0800 Subject: [PATCH 4/8] update tidb dep --- go.mod | 6 +++--- go.sum | 8 ++++++++ 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index d61f014a9..9eb8bc47e 100644 --- a/go.mod +++ b/go.mod @@ -22,9 +22,9 @@ require ( github.com/pingcap/errors v0.11.5-0.20190809092503-95897b64e011 github.com/pingcap/kvproto v0.0.0-20200221125103-35b65c96516e github.com/pingcap/log v0.0.0-20200117041106-d28c14d3b1cd - github.com/pingcap/parser v0.0.0-20200218113622-517beb2e39c2 + github.com/pingcap/parser v0.0.0-20200301092054-bfc519c0a57f github.com/pingcap/pd v1.1.0-beta.0.20200106144140-f5a7aa985497 - github.com/pingcap/tidb v1.1.0-beta.0.20200303080309-9ae471c0eea8 + github.com/pingcap/tidb v1.1.0-beta.0.20200305113516-ac15dd336c93 github.com/pingcap/tidb-tools v4.0.0-beta+incompatible github.com/pingcap/tipb v0.0.0-20200212061130-c4d518eb1d60 github.com/prometheus/client_golang v1.0.0 @@ -35,7 +35,7 @@ require ( github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5 // indirect go.etcd.io/etcd v0.5.0-alpha.5.0.20191023171146-3cf2f69b5738 go.opencensus.io v0.22.2 // indirect - go.uber.org/zap v1.13.0 + go.uber.org/zap v1.14.0 golang.org/x/net v0.0.0-20191011234655-491137f69257 // indirect golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45 golang.org/x/tools v0.0.0-20200226224502-204d844ad48d // indirect diff --git a/go.sum b/go.sum index b02bcf90e..955b5135d 100644 --- a/go.sum +++ b/go.sum @@ -138,6 +138,7 @@ github.com/golang/protobuf v1.3.2 h1:6nsPYzhq5kReh6QImI3k5qWzO4PEbvbIW2cwSfR/6xs github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.3 h1:gyjaxf+svBWX08ZjK86iN9geUJF0H6gp2IRKX6Nf6/I= github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db h1:woRePGFeVFfLKN/pOkfl+p/TAqKOfFu+7KPlMVpok/w= github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.1 h1:Qgr9rKW7uDUkrbSmQeiDsGa8SjGyCOGtuasMWwvp2P4= @@ -315,14 +316,18 @@ github.com/pingcap/log v0.0.0-20200117041106-d28c14d3b1cd h1:CV3VsP3Z02MVtdpTMfE github.com/pingcap/log v0.0.0-20200117041106-d28c14d3b1cd/go.mod h1:4rbK1p9ILyIfb6hU7OG2CiWSqMXnp3JMbiaVJ6mvoY8= github.com/pingcap/parser v0.0.0-20200218113622-517beb2e39c2 h1:DsymejjOFdljM1q0BJ8yBZUYQ7718+7JTO046Rqd/3k= github.com/pingcap/parser v0.0.0-20200218113622-517beb2e39c2/go.mod h1:9v0Edh8IbgjGYW2ArJr19E+bvL8zKahsFp+ixWeId+4= +github.com/pingcap/parser v0.0.0-20200301092054-bfc519c0a57f/go.mod h1:9v0Edh8IbgjGYW2ArJr19E+bvL8zKahsFp+ixWeId+4= github.com/pingcap/pd v1.1.0-beta.0.20200106144140-f5a7aa985497 h1:FzLErYtcXnSxtC469OuVDlgBbh0trJZzNxw0mNKzyls= github.com/pingcap/pd v1.1.0-beta.0.20200106144140-f5a7aa985497/go.mod h1:cfT/xu4Zz+Tkq95QrLgEBZ9ikRcgzy4alHqqoaTftqI= github.com/pingcap/sysutil v0.0.0-20191216090214-5f9620d22b3b h1:EEyo/SCRswLGuSk+7SB86Ak1p8bS6HL1Mi4Dhyuv6zg= github.com/pingcap/sysutil v0.0.0-20191216090214-5f9620d22b3b/go.mod h1:EB/852NMQ+aRKioCpToQ94Wl7fktV+FNnxf3CX/TTXI= github.com/pingcap/sysutil v0.0.0-20200206130906-2bfa6dc40bcd h1:k7CIHMFVKjHsda3PKkiN4zv++NEnexlUwiJEhryWpG0= github.com/pingcap/sysutil v0.0.0-20200206130906-2bfa6dc40bcd/go.mod h1:EB/852NMQ+aRKioCpToQ94Wl7fktV+FNnxf3CX/TTXI= +github.com/pingcap/sysutil v0.0.0-20200302022240-21c8c70d0ab1/go.mod h1:EB/852NMQ+aRKioCpToQ94Wl7fktV+FNnxf3CX/TTXI= github.com/pingcap/tidb v1.1.0-beta.0.20200303080309-9ae471c0eea8 h1:YgPH0M0t0lE+vIKEXhKNSAQi822wKRIW7+RhcwVFCKw= github.com/pingcap/tidb v1.1.0-beta.0.20200303080309-9ae471c0eea8/go.mod h1:untj2MAKBepgebXTYWRsEW54UvngfHxn2zUy6gp8ITo= +github.com/pingcap/tidb v1.1.0-beta.0.20200305113516-ac15dd336c93 h1:UT35i5wbPOj99EMzf/pkqrq2asguXmZD5Q1P6mnRb9U= +github.com/pingcap/tidb v1.1.0-beta.0.20200305113516-ac15dd336c93/go.mod h1:fgAq363ZYMeSvCc1jzOEHeG9001fRjoFQiBIRdXdPKo= github.com/pingcap/tidb-tools v3.0.6-0.20191106033616-90632dda3863+incompatible h1:H1jg0aDWz2SLRh3hNBo2HFtnuHtudIUvBumU7syRkic= github.com/pingcap/tidb-tools v3.0.6-0.20191106033616-90632dda3863+incompatible/go.mod h1:XGdcy9+yqlDSEMTpOXnwf3hiTeqrV6MN/u1se9N8yIM= github.com/pingcap/tidb-tools v4.0.0-beta+incompatible h1:+XJdcVLCM8GDgXiMS6lFV59N3XPVOqtNHeWNLVrb2pg= @@ -437,6 +442,7 @@ go.uber.org/atomic v1.5.0 h1:OI5t8sDa1Or+q8AeE+yKeB/SDYioSHAgcVljj9JIETY= go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= go.uber.org/atomic v1.5.1 h1:rsqfU5vBkVknbhUGbAUwQKR2H4ItV8tjJ+6kJX4cxHM= go.uber.org/atomic v1.5.1/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= +go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= go.uber.org/automaxprocs v1.2.0/go.mod h1:YfO3fm683kQpzETxlTGZhGIVmXAhaw3gxeBADbpZtnU= go.uber.org/goleak v0.10.0 h1:G3eWbSNIskeRqtsN/1uI5B+eP73y3JUuBsv9AZjehb4= go.uber.org/goleak v0.10.0/go.mod h1:VCZuO8V8mFPlL0F5J5GK1rtHV3DrFcQ1R8ryq7FK0aI= @@ -445,6 +451,7 @@ go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/ go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= go.uber.org/multierr v1.4.0 h1:f3WCSC2KzAcBXGATIxAB1E2XuCpNU255wNKZ505qi3E= go.uber.org/multierr v1.4.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= +go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKYU= go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee h1:0mgffUl7nfd+FpvXMVz4IDEaUSmT1ysygQC7qYo7sG4= go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= go.uber.org/zap v1.9.1/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= @@ -454,6 +461,7 @@ go.uber.org/zap v1.12.0 h1:dySoUQPFBGj6xwjmBzageVL8jGi8uxc6bEmJQjA06bw= go.uber.org/zap v1.12.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= go.uber.org/zap v1.13.0 h1:nR6NoDBgAf67s68NhaXbsojM+2gxp3S1hWkHDl27pVU= go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= +go.uber.org/zap v1.14.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= From bd9eb1249a20c3852e29ebb7729162d7603d8678 Mon Sep 17 00:00:00 2001 From: luancheng Date: Mon, 9 Mar 2020 14:36:27 +0800 Subject: [PATCH 5/8] fix ci --- go.sum | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/go.sum b/go.sum index 1b1920b2f..65a64ffea 100644 --- a/go.sum +++ b/go.sum @@ -138,8 +138,7 @@ github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5y github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2 h1:6nsPYzhq5kReh6QImI3k5qWzO4PEbvbIW2cwSfR/6xs= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.3 h1:gyjaxf+svBWX08ZjK86iN9geUJF0H6gp2IRKX6Nf6/I= -github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.3.4 h1:87PNWwrRvUSnqS4dlcBU/ftvOIBep4sYuBLlh6rX2wk= github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db h1:woRePGFeVFfLKN/pOkfl+p/TAqKOfFu+7KPlMVpok/w= github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= @@ -316,18 +315,14 @@ github.com/pingcap/log v0.0.0-20191012051959-b742a5d432e9 h1:AJD9pZYm72vMgPcQDww github.com/pingcap/log v0.0.0-20191012051959-b742a5d432e9/go.mod h1:4rbK1p9ILyIfb6hU7OG2CiWSqMXnp3JMbiaVJ6mvoY8= github.com/pingcap/log v0.0.0-20200117041106-d28c14d3b1cd h1:CV3VsP3Z02MVtdpTMfEgRJ4T9NGgGTxdHpJerent7rM= github.com/pingcap/log v0.0.0-20200117041106-d28c14d3b1cd/go.mod h1:4rbK1p9ILyIfb6hU7OG2CiWSqMXnp3JMbiaVJ6mvoY8= -github.com/pingcap/parser v0.0.0-20200218113622-517beb2e39c2 h1:DsymejjOFdljM1q0BJ8yBZUYQ7718+7JTO046Rqd/3k= -github.com/pingcap/parser v0.0.0-20200218113622-517beb2e39c2/go.mod h1:9v0Edh8IbgjGYW2ArJr19E+bvL8zKahsFp+ixWeId+4= +github.com/pingcap/parser v0.0.0-20200301092054-bfc519c0a57f h1:SfzX0ZDTyXgzLExMsJ385DTMIaX7CeBQMCGQKdQYO7o= github.com/pingcap/parser v0.0.0-20200301092054-bfc519c0a57f/go.mod h1:9v0Edh8IbgjGYW2ArJr19E+bvL8zKahsFp+ixWeId+4= github.com/pingcap/pd v1.1.0-beta.0.20200106144140-f5a7aa985497 h1:FzLErYtcXnSxtC469OuVDlgBbh0trJZzNxw0mNKzyls= github.com/pingcap/pd v1.1.0-beta.0.20200106144140-f5a7aa985497/go.mod h1:cfT/xu4Zz+Tkq95QrLgEBZ9ikRcgzy4alHqqoaTftqI= github.com/pingcap/sysutil v0.0.0-20191216090214-5f9620d22b3b h1:EEyo/SCRswLGuSk+7SB86Ak1p8bS6HL1Mi4Dhyuv6zg= github.com/pingcap/sysutil v0.0.0-20191216090214-5f9620d22b3b/go.mod h1:EB/852NMQ+aRKioCpToQ94Wl7fktV+FNnxf3CX/TTXI= -github.com/pingcap/sysutil v0.0.0-20200206130906-2bfa6dc40bcd h1:k7CIHMFVKjHsda3PKkiN4zv++NEnexlUwiJEhryWpG0= -github.com/pingcap/sysutil v0.0.0-20200206130906-2bfa6dc40bcd/go.mod h1:EB/852NMQ+aRKioCpToQ94Wl7fktV+FNnxf3CX/TTXI= +github.com/pingcap/sysutil v0.0.0-20200302022240-21c8c70d0ab1 h1:YUnUZ914SHFMsOSe/xgH5DKK/thtRma8X8hcszRo3CA= github.com/pingcap/sysutil v0.0.0-20200302022240-21c8c70d0ab1/go.mod h1:EB/852NMQ+aRKioCpToQ94Wl7fktV+FNnxf3CX/TTXI= -github.com/pingcap/tidb v1.1.0-beta.0.20200303080309-9ae471c0eea8 h1:YgPH0M0t0lE+vIKEXhKNSAQi822wKRIW7+RhcwVFCKw= -github.com/pingcap/tidb v1.1.0-beta.0.20200303080309-9ae471c0eea8/go.mod h1:untj2MAKBepgebXTYWRsEW54UvngfHxn2zUy6gp8ITo= github.com/pingcap/tidb v1.1.0-beta.0.20200305113516-ac15dd336c93 h1:UT35i5wbPOj99EMzf/pkqrq2asguXmZD5Q1P6mnRb9U= github.com/pingcap/tidb v1.1.0-beta.0.20200305113516-ac15dd336c93/go.mod h1:fgAq363ZYMeSvCc1jzOEHeG9001fRjoFQiBIRdXdPKo= github.com/pingcap/tidb-tools v3.0.6-0.20191106033616-90632dda3863+incompatible h1:H1jg0aDWz2SLRh3hNBo2HFtnuHtudIUvBumU7syRkic= @@ -442,8 +437,7 @@ go.uber.org/atomic v1.3.2 h1:2Oa65PReHzfn29GpvgsYwloV9AVFHPDk8tYxt2c2tr4= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.5.0 h1:OI5t8sDa1Or+q8AeE+yKeB/SDYioSHAgcVljj9JIETY= go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= -go.uber.org/atomic v1.5.1 h1:rsqfU5vBkVknbhUGbAUwQKR2H4ItV8tjJ+6kJX4cxHM= -go.uber.org/atomic v1.5.1/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= +go.uber.org/atomic v1.6.0 h1:Ezj3JGmsOnG1MoRWQkPBsKLe9DwWD9QeXzTRzzldNVk= go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= go.uber.org/automaxprocs v1.2.0/go.mod h1:YfO3fm683kQpzETxlTGZhGIVmXAhaw3gxeBADbpZtnU= go.uber.org/goleak v0.10.0 h1:G3eWbSNIskeRqtsN/1uI5B+eP73y3JUuBsv9AZjehb4= @@ -453,6 +447,7 @@ go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/ go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= go.uber.org/multierr v1.4.0 h1:f3WCSC2KzAcBXGATIxAB1E2XuCpNU255wNKZ505qi3E= go.uber.org/multierr v1.4.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= +go.uber.org/multierr v1.5.0 h1:KCa4XfM8CWFCpxXRGok+Q0SS/0XBhMDbHHGABQLvD2A= go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKYU= go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee h1:0mgffUl7nfd+FpvXMVz4IDEaUSmT1ysygQC7qYo7sG4= go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= @@ -461,8 +456,7 @@ go.uber.org/zap v1.10.0 h1:ORx85nbTijNz8ljznvCMR1ZBIPKFn3jQrag10X2AsuM= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.12.0 h1:dySoUQPFBGj6xwjmBzageVL8jGi8uxc6bEmJQjA06bw= go.uber.org/zap v1.12.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= -go.uber.org/zap v1.13.0 h1:nR6NoDBgAf67s68NhaXbsojM+2gxp3S1hWkHDl27pVU= -go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= +go.uber.org/zap v1.14.0 h1:/pduUoebOeeJzTDFuoMgC6nRkiasr1sBCIEorly7m4o= go.uber.org/zap v1.14.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= From bc9f20b66277f0bfcdc946fa51b8e6cf0ed560d5 Mon Sep 17 00:00:00 2001 From: luancheng Date: Mon, 9 Mar 2020 16:11:24 +0800 Subject: [PATCH 6/8] update race flag --- Makefile | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index eea680b74..e8fa98509 100644 --- a/Makefile +++ b/Makefile @@ -12,27 +12,32 @@ LDFLAGS += -X "$(BR_PKG)/pkg/utils.BRBuildTS=$(shell date -u '+%Y-%m-%d %I:%M:%S LDFLAGS += -X "$(BR_PKG)/pkg/utils.BRGitHash=$(shell git rev-parse HEAD)" LDFLAGS += -X "$(BR_PKG)/pkg/utils.BRGitBranch=$(shell git rev-parse --abbrev-ref HEAD)" -all: check test build +RACEFLAG = "" +ifeq ("$(WITH_RACE)", "1") + RACEFLAG = -race +endif -release: - GO111MODULE=on go build -ldflags '$(LDFLAGS)' -o bin/br +all: check test build build: - GO111MODULE=on go build -ldflags '$(LDFLAGS)' -race -o bin/br + GO111MODULE=on go build -ldflags '$(LDFLAGS)' ${RACEFLAG} -o bin/br + +dev: + GO111MODULE=on go build -ldflags '$(LDFLAGS)' ${RACEFLAG} -o bin/br build_for_integration_test: GO111MODULE=on go test -c -cover -covermode=count \ -coverpkg=$(BR_PKG)/... \ -o bin/br.test # build key locker - GO111MODULE=on go build -race -o bin/locker tests/br_key_locked/*.go + GO111MODULE=on go build ${RACEFLAG} -o bin/locker tests/br_key_locked/*.go # build gc - GO111MODULE=on go build -race -o bin/gc tests/br_z_gc_safepoint/*.go + GO111MODULE=on go build ${RACEFLAG} -o bin/gc tests/br_z_gc_safepoint/*.go # build rawkv client - GO111MODULE=on go build -race -o bin/rawkv tests/br_rawkv/*.go + GO111MODULE=on go build ${RACEFLAG} -o bin/rawkv tests/br_rawkv/*.go test: - GO111MODULE=on go test -race -tags leak ./... + GO111MODULE=on go test ${RACEFLAG} -tags leak ./... testcover: GO111MODULE=on retool do overalls \ From c29d673c7fbe4b793c328315c6a9e7e1cc7f5603 Mon Sep 17 00:00:00 2001 From: luancheng Date: Mon, 9 Mar 2020 16:22:24 +0800 Subject: [PATCH 7/8] update command settings --- Makefile | 4 ---- cmd/backup.go | 1 + cmd/restore.go | 1 + cmd/validate.go | 1 + main.go | 4 +--- 5 files changed, 4 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index e8fa98509..01458c70c 100644 --- a/Makefile +++ b/Makefile @@ -12,7 +12,6 @@ LDFLAGS += -X "$(BR_PKG)/pkg/utils.BRBuildTS=$(shell date -u '+%Y-%m-%d %I:%M:%S LDFLAGS += -X "$(BR_PKG)/pkg/utils.BRGitHash=$(shell git rev-parse HEAD)" LDFLAGS += -X "$(BR_PKG)/pkg/utils.BRGitBranch=$(shell git rev-parse --abbrev-ref HEAD)" -RACEFLAG = "" ifeq ("$(WITH_RACE)", "1") RACEFLAG = -race endif @@ -22,9 +21,6 @@ all: check test build build: GO111MODULE=on go build -ldflags '$(LDFLAGS)' ${RACEFLAG} -o bin/br -dev: - GO111MODULE=on go build -ldflags '$(LDFLAGS)' ${RACEFLAG} -o bin/br - build_for_integration_test: GO111MODULE=on go test -c -cover -covermode=count \ -coverpkg=$(BR_PKG)/... \ diff --git a/cmd/backup.go b/cmd/backup.go index a0a6bcecb..1218c3baf 100644 --- a/cmd/backup.go +++ b/cmd/backup.go @@ -31,6 +31,7 @@ func NewBackupCommand() *cobra.Command { command := &cobra.Command{ Use: "backup", Short: "backup a TiDB cluster", + SilenceUsage: false, PersistentPreRunE: func(c *cobra.Command, args []string) error { if err := Init(c); err != nil { return err diff --git a/cmd/restore.go b/cmd/restore.go index 9f7c47bdb..36f763cc5 100644 --- a/cmd/restore.go +++ b/cmd/restore.go @@ -22,6 +22,7 @@ func NewRestoreCommand() *cobra.Command { command := &cobra.Command{ Use: "restore", Short: "restore a TiKV cluster from a backup", + SilenceUsage: false, PersistentPreRunE: func(c *cobra.Command, args []string) error { if err := Init(c); err != nil { return err diff --git a/cmd/validate.go b/cmd/validate.go index d358995a3..26f77da2a 100644 --- a/cmd/validate.go +++ b/cmd/validate.go @@ -29,6 +29,7 @@ func NewValidateCommand() *cobra.Command { meta := &cobra.Command{ Use: "validate ", Short: "commands to check/debug backup data", + SilenceUsage: false, PersistentPreRunE: func(c *cobra.Command, args []string) error { if err := Init(c); err != nil { return err diff --git a/main.go b/main.go index 103699614..7b7cbfc97 100644 --- a/main.go +++ b/main.go @@ -7,7 +7,6 @@ import ( "os/signal" "syscall" - "github.com/pingcap/errors" "github.com/spf13/cobra" "github.com/pingcap/br/cmd" @@ -42,7 +41,7 @@ func main() { Use: "br", Short: "br is a TiDB/TiKV cluster backup restore tool.", TraverseChildren: true, - SilenceUsage: true, + SilenceUsage: false, } cmd.AddFlags(rootCmd) cmd.SetDefaultContext(ctx) @@ -53,7 +52,6 @@ func main() { ) rootCmd.SetArgs(os.Args[1:]) if err := rootCmd.Execute(); err != nil { - rootCmd.Println(errors.ErrorStack(err)) os.Exit(1) } } From fc5a6209fc6a77296403779598dc7d938bb79675 Mon Sep 17 00:00:00 2001 From: luancheng Date: Mon, 9 Mar 2020 16:45:32 +0800 Subject: [PATCH 8/8] fix ci --- cmd/backup.go | 4 ++-- cmd/restore.go | 4 ++-- cmd/validate.go | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cmd/backup.go b/cmd/backup.go index 1218c3baf..5dc6e3a32 100644 --- a/cmd/backup.go +++ b/cmd/backup.go @@ -29,8 +29,8 @@ func runBackupRawCommand(command *cobra.Command, cmdName string) error { // NewBackupCommand return a full backup subcommand. func NewBackupCommand() *cobra.Command { command := &cobra.Command{ - Use: "backup", - Short: "backup a TiDB cluster", + Use: "backup", + Short: "backup a TiDB cluster", SilenceUsage: false, PersistentPreRunE: func(c *cobra.Command, args []string) error { if err := Init(c); err != nil { diff --git a/cmd/restore.go b/cmd/restore.go index 36f763cc5..f508f0342 100644 --- a/cmd/restore.go +++ b/cmd/restore.go @@ -20,8 +20,8 @@ func runRestoreCommand(command *cobra.Command, cmdName string) error { // NewRestoreCommand returns a restore subcommand func NewRestoreCommand() *cobra.Command { command := &cobra.Command{ - Use: "restore", - Short: "restore a TiKV cluster from a backup", + Use: "restore", + Short: "restore a TiKV cluster from a backup", SilenceUsage: false, PersistentPreRunE: func(c *cobra.Command, args []string) error { if err := Init(c); err != nil { diff --git a/cmd/validate.go b/cmd/validate.go index 26f77da2a..91ee645ac 100644 --- a/cmd/validate.go +++ b/cmd/validate.go @@ -27,8 +27,8 @@ import ( // NewValidateCommand return a debug subcommand. func NewValidateCommand() *cobra.Command { meta := &cobra.Command{ - Use: "validate ", - Short: "commands to check/debug backup data", + Use: "validate ", + Short: "commands to check/debug backup data", SilenceUsage: false, PersistentPreRunE: func(c *cobra.Command, args []string) error { if err := Init(c); err != nil {