Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

*: upgrade to go 1.12 #9299

Merged
merged 4 commits into from Mar 9, 2019

Conversation

Projects
None yet
8 participants
@yangwenmai
Copy link
Contributor

yangwenmai commented Feb 14, 2019

What problem does this PR solve?

upgrade to go 1.12

@yangwenmai yangwenmai changed the title chore(config): upgrade to go 1.11.5 *: upgrade to go 1.11.5 Feb 14, 2019

@yangwenmai

This comment has been minimized.

Copy link
Contributor Author

yangwenmai commented Feb 14, 2019

idc-jenkins-ci-tidb/build and idc-jenkins-ci-tidb/check_dev failed, Need to go clean -modcache

@zz-jason zz-jason requested a review from tiancaiamao Feb 14, 2019

@tiancaiamao

This comment has been minimized.

Copy link
Contributor

tiancaiamao commented Feb 14, 2019

This may also affect release-2.0 release-2.1 branch
PTAL @zyguan

@zz-jason

This comment has been minimized.

Copy link
Member

zz-jason commented Feb 14, 2019

should we also use go 1.11.5 in the parser repo?

@yangwenmai

This comment has been minimized.

Copy link
Contributor Author

yangwenmai commented Feb 14, 2019

parser repo use docker image: golang:1.11, It should be use go 1.11.5.

@zyguan

This comment has been minimized.

Copy link
Contributor

zyguan commented Feb 14, 2019

Hi, @yangwenmai , our jenkins uses K8s to run tests. To speed up tests, we also build base image with mod cache and it's currently based on go 1.11.2. So there're still checksum mismatches even after go clean -modcache, you can check this build. Maybe we need to upgrade base image as well, it'll take some time to do it because we have to make sure the changes won't break other projects.

@yangwenmai

This comment has been minimized.

Copy link
Contributor Author

yangwenmai commented Feb 14, 2019

We must be upgrade go env to go 1.11.5, I'm waiting for those repo changed.

@zz-jason

This comment has been minimized.

Copy link
Member

zz-jason commented Feb 27, 2019

@yangwenmai Go 1.12 was released, can we upgrade to that version?

@yangwenmai

This comment has been minimized.

Copy link
Contributor Author

yangwenmai commented Mar 1, 2019

@yangwenmai Go 1.12 was released, can we upgrade to that version?

ok, I upgrade to go1.12

@yangwenmai yangwenmai force-pushed the yangwenmai:upgrade_go_version branch from 14cc303 to baa2bdf Mar 1, 2019

@codecov-io

This comment has been minimized.

Copy link

codecov-io commented Mar 1, 2019

Codecov Report

Merging #9299 into master will increase coverage by 0.0114%.
The diff coverage is n/a.

@@               Coverage Diff                @@
##             master      #9299        +/-   ##
================================================
+ Coverage   67.3773%   67.3887%   +0.0114%     
================================================
  Files           374        374                
  Lines         78942      78936         -6     
================================================
+ Hits          53189      53194         +5     
+ Misses        20998      20991         -7     
+ Partials       4755       4751         -4

@yangwenmai yangwenmai changed the title *: upgrade to go 1.11.5 *: upgrade to go 1.12 Mar 1, 2019

@tiancaiamao

This comment has been minimized.

Copy link
Contributor

tiancaiamao commented Mar 4, 2019

I'll trying go 1.12 and find go mod tidy will upgrade pd to 2.1.5

git diff go.mod

diff --git a/go.mod b/go.mod
index 29584e72d..bf9c0d209 100644
--- a/go.mod
+++ b/go.mod
@@ -17,7 +17,6 @@ require (
        github.com/dgrijalva/jwt-go v3.2.0+incompatible // indirect
        github.com/dustin/go-humanize v1.0.0 // indirect
        github.com/eknkc/amber v0.0.0-20171010120322-cdade1c07385 // indirect
-       github.com/etcd-io/gofail v0.0.0-20180808172546-51ce9a71510a // indirect
        github.com/ghodss/yaml v1.0.0 // indirect
        github.com/go-ole/go-ole v1.2.1 // indirect
        github.com/go-sql-driver/mysql v0.0.0-20170715192408-3955978caca4
@@ -50,7 +49,7 @@ require (
        github.com/pingcap/kvproto v0.0.0-20190215154024-7f2fc73ef562
        github.com/pingcap/log v0.0.0-20190214045112-b37da76f67a7
        github.com/pingcap/parser v0.0.0-20190228070002-74e8cffabf28
-       github.com/pingcap/pd v2.1.0-rc.4+incompatible
+       github.com/pingcap/pd v2.1.5+incompatible
        github.com/pingcap/tidb-tools v2.1.3-0.20190116051332-34c808eef588+incompatible
        github.com/pingcap/tipb v0.0.0-20190107072121-abbec73437b7
        github.com/prometheus/client_golang v0.9.0

And tidb fails to build with pd 2.1.5

➜  tidb git:(create-partition-column) ✗ make            
CGO_ENABLED=1 GO111MODULE=on go build   -ldflags '-X "github.com/pingcap/parser/mysql.TiDBReleaseVersion=v2.1.5-16-g02ab76755-dirty" -X "github.com/pingcap/tidb/util/printer.TiDBBuildTS=2019-03-04 03:02:54" -X "github.com/pingcap/tidb/util/printer.TiDBGitHash=02ab76755867c1ae0024ad8ede868fe529c89f2a" -X "github.com/pingcap/tidb/util/printer.TiDBGitBranch=create-partition-column" -X "github.com/pingcap/tidb/util/printer.GoVersion=go version go1.12 linux/amd64" ' -o bin/tidb-server tidb-server/main.go
# github.com/pingcap/pd/client
../../../../pkg/mod/github.com/pingcap/pd@v2.1.5+incompatible/client/client.go:715:3: unknown field 'ExcludeTombstoneStores' in struct literal of type pdpb.GetAllStoresRequest
Makefile:165: recipe for target 'server' failed
make: *** [server] Error 2

Have you ever meet this problem? @yangwenmai
/cc @disksing

@disksing

This comment has been minimized.

Copy link
Member

disksing commented Mar 4, 2019

I think it is better to use pd@master explicitly.

@yangwenmai

This comment has been minimized.

Copy link
Contributor Author

yangwenmai commented Mar 5, 2019

I have no error on my side use go1.12 to make.

Build TiDB Server successfully!

@xiekeyi98

This comment has been minimized.

Copy link
Member

xiekeyi98 commented Mar 5, 2019

@tiancaiamao
I can not reproduce it .
I was wondering if you could tell me someway to reproduce it ?
Here is what I do .

xiekeyi@ubuntu:~/gopath/src/github.com/pingcap/tidb$ git log --pretty=oneline | head -5
d7ac1138e837670248c69dbc9f46292313f2d846 store/tikv: add sanity check for startTS in 2pc (#9555)
63b49c9e42ec51022e6e4e385d17b202dcf76c6d util: fix issue #9532, quote database name before running SQL with it (#9547)
d094a0fc973c11eb177d6b51f2e4b9ef51848e8d planner: convert SemiJoin to InnerJoin in more cases (#9546)
d81f65f5774d2a5c6877ba77c2b8ffe6f52bf226 planner: fix false negative "full group by" check for agg in subquery (#9542)
e7ff050a453c8b8564b30c7c55b993a11c44b1d9 planner, executor: support SQL `show pump/drainer status` (#9456)
xiekeyi@ubuntu:~/gopath/src/github.com/pingcap/tidb$ git status
位于分支 master
您的分支领先 'origin/master' 共 1 个提交。
  (使用 "git push" 来发布您的本地提交)

无文件要提交,干净的工作区
xiekeyi@ubuntu:~/gopath/src/github.com/pingcap/tidb$ go version
go version go1.12 linux/amd64
xiekeyi@ubuntu:~/gopath/src/github.com/pingcap/tidb$ make 
CGO_ENABLED=1 GO111MODULE=on go build   -ldflags '-X "github.com/pingcap/parser/mysql.TiDBReleaseVersion=v3.0.0-beta-154-gd7ac1138e" -X "github.com/pingcap/tidb/util/printer.TiDBBuildTS=2019-03-05 11:56:39" -X "github.com/pingcap/tidb/util/printer.TiDBGitHash=d7ac1138e837670248c69dbc9f46292313f2d846" -X "github.com/pingcap/tidb/util/printer.TiDBGitBranch=master" -X "github.com/pingcap/tidb/util/printer.GoVersion=go version go1.12 linux/amd64" ' -o bin/tidb-server tidb-server/main.go
verifying github.com/coreos/etcd@v3.3.10+incompatible: checksum mismatch
	downloaded: h1:jFneRYjIvLMLhDLCzuTuU4rSJUjRplcJQ7pD7MnhC04=
	go.sum:     h1:KjVWqrZ5U0wa3CxY2AxlH6/UcB+PK2td1DcsYhA+HRs=
Makefile:165: recipe for target 'server' failed
make: *** [server] Error 1
xiekeyi@ubuntu:~/gopath/src/github.com/pingcap/tidb$ rm go.sum
xiekeyi@ubuntu:~/gopath/src/github.com/pingcap/tidb$ make 
CGO_ENABLED=1 GO111MODULE=on go build   -ldflags '-X "github.com/pingcap/parser/mysql.TiDBReleaseVersion=v3.0.0-beta-154-gd7ac1138e-dirty" -X "github.com/pingcap/tidb/util/printer.TiDBBuildTS=2019-03-05 11:56:41" -X "github.com/pingcap/tidb/util/printer.TiDBGitHash=d7ac1138e837670248c69dbc9f46292313f2d846" -X "github.com/pingcap/tidb/util/printer.TiDBGitBranch=master" -X "github.com/pingcap/tidb/util/printer.GoVersion=go version go1.12 linux/amd64" ' -o bin/tidb-server tidb-server/main.go
Build TiDB Server successfully!
xiekeyi@ubuntu:~/gopath/src/github.com/pingcap/tidb$ go mod tidy
go: modules disabled inside GOPATH/src by GO111MODULE=auto; see 'go help modules'
xiekeyi@ubuntu:~/gopath/src/github.com/pingcap/tidb$ GO111MODULE=on go mod tidy
xiekeyi@ubuntu:~/gopath/src/github.com/pingcap/tidb$ make 
CGO_ENABLED=1 GO111MODULE=on go build   -ldflags '-X "github.com/pingcap/parser/mysql.TiDBReleaseVersion=v3.0.0-beta-154-gd7ac1138e-dirty" -X "github.com/pingcap/tidb/util/printer.TiDBBuildTS=2019-03-05 11:57:45" -X "github.com/pingcap/tidb/util/printer.TiDBGitHash=d7ac1138e837670248c69dbc9f46292313f2d846" -X "github.com/pingcap/tidb/util/printer.TiDBGitBranch=master" -X "github.com/pingcap/tidb/util/printer.GoVersion=go version go1.12 linux/amd64" ' -o bin/tidb-server tidb-server/main.go
Build TiDB Server successfully!
@zyguan

This comment has been minimized.

Copy link
Contributor

zyguan commented Mar 5, 2019

/rebuild

@zyguan

This comment has been minimized.

Copy link
Contributor

zyguan commented Mar 5, 2019

/run-all-tests

@tiancaiamao

This comment has been minimized.

Copy link
Contributor

tiancaiamao commented Mar 6, 2019

➜  tidb git:(master) git pull  
remote: Enumerating objects: 4, done.
remote: Counting objects: 100% (4/4), done.
remote: Total 4 (delta 3), reused 4 (delta 3), pack-reused 0
Unpacking objects: 100% (4/4), done.
From github.com:pingcap/tidb
   d7ac1138e..4ccc4c1bc  master     -> origin/master
Updating d7ac1138e..4ccc4c1bc
Fast-forward
 executor/executor_test.go | 1 +
 1 file changed, 1 insertion(+)


➜  tidb git:(master) go version
go version go1.12 linux/amd64


➜  tidb git:(master) make check         
gofmt (simplify)
errcheck
linting
go mod tidy
./tools/check/check-tidy.sh
go: finding github.com/pingcap/pd/server/core latest
go: finding github.com/pingcap/pd/server latest
Makefile:105: recipe for target 'tidy' failed
make: *** [tidy] Error 1


➜  tidb git:(master) ✗ git diff --stat |cat
 go.mod | 3 +--
 go.sum | 6 ++----
 2 files changed, 3 insertions(+), 6 deletions(-)


➜  tidb git:(master) ✗ git diff |cat       
diff --git a/go.mod b/go.mod
index 29584e72d..bf9c0d209 100644
--- a/go.mod
+++ b/go.mod
@@ -17,7 +17,6 @@ require (
 	github.com/dgrijalva/jwt-go v3.2.0+incompatible // indirect
 	github.com/dustin/go-humanize v1.0.0 // indirect
 	github.com/eknkc/amber v0.0.0-20171010120322-cdade1c07385 // indirect
-	github.com/etcd-io/gofail v0.0.0-20180808172546-51ce9a71510a // indirect
 	github.com/ghodss/yaml v1.0.0 // indirect
 	github.com/go-ole/go-ole v1.2.1 // indirect
 	github.com/go-sql-driver/mysql v0.0.0-20170715192408-3955978caca4
@@ -50,7 +49,7 @@ require (
 	github.com/pingcap/kvproto v0.0.0-20190215154024-7f2fc73ef562
 	github.com/pingcap/log v0.0.0-20190214045112-b37da76f67a7
 	github.com/pingcap/parser v0.0.0-20190228070002-74e8cffabf28
-	github.com/pingcap/pd v2.1.0-rc.4+incompatible
+	github.com/pingcap/pd v2.1.5+incompatible
 	github.com/pingcap/tidb-tools v2.1.3-0.20190116051332-34c808eef588+incompatible
 	github.com/pingcap/tipb v0.0.0-20190107072121-abbec73437b7
 	github.com/prometheus/client_golang v0.9.0
diff --git a/go.sum b/go.sum
index b5fddb8c4..18fa1c179 100644
--- a/go.sum
+++ b/go.sum
@@ -35,8 +35,6 @@ github.com/dustin/go-humanize v1.0.0 h1:VSnTsYCnlFHaM2/igO1h6X3HA71jcobQuxemgkq4
 github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk=
 github.com/eknkc/amber v0.0.0-20171010120322-cdade1c07385 h1:clC1lXBpe2kTj2VHdaIu9ajZQe4kcEY9j0NsnDDBZ3o=
 github.com/eknkc/amber v0.0.0-20171010120322-cdade1c07385/go.mod h1:0vRUJqYpeSZifjYj7uP3BG/gKcuzL9xWVV/Y+cK33KM=
-github.com/etcd-io/gofail v0.0.0-20180808172546-51ce9a71510a h1:QNEenQIsGDEEfFNSnN+h6hE1OwnHqTg7Dl9gEk1Cko4=
-github.com/etcd-io/gofail v0.0.0-20180808172546-51ce9a71510a/go.mod h1:49H/RkXP8pKaZy4h0d+NW16rSLhyVBt4o6VLJbmOqDE=
 github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I=
 github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
 github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk=
@@ -115,8 +113,8 @@ github.com/pingcap/log v0.0.0-20190214045112-b37da76f67a7 h1:kOHAMalwF69bJrtWrOd
 github.com/pingcap/log v0.0.0-20190214045112-b37da76f67a7/go.mod h1:xsfkWVaFVV5B8e1K9seWfyJWFrIhbtUTAD8NV1Pq3+w=
 github.com/pingcap/parser v0.0.0-20190228070002-74e8cffabf28 h1:pOOCEgCZHvY4H3kZNZjzru6nZfpbw54QA5EuZWjH/TE=
 github.com/pingcap/parser v0.0.0-20190228070002-74e8cffabf28/go.mod h1:1FNvfp9+J0wvc4kl8eGNh7Rqrxveg15jJoWo/a0uHwA=
-github.com/pingcap/pd v2.1.0-rc.4+incompatible h1:/buwGk04aHO5odk/+O8ZOXGs4qkUjYTJ2UpCJXna8NE=
-github.com/pingcap/pd v2.1.0-rc.4+incompatible/go.mod h1:nD3+EoYes4+aNNODO99ES59V83MZSI+dFbhyr667a0E=
+github.com/pingcap/pd v2.1.5+incompatible h1:vOLV2tSQdRjjmxaTXtJULoC94dYQOd+6fzn2yChODHc=
+github.com/pingcap/pd v2.1.5+incompatible/go.mod h1:nD3+EoYes4+aNNODO99ES59V83MZSI+dFbhyr667a0E=
 github.com/pingcap/tidb-tools v2.1.3-0.20190116051332-34c808eef588+incompatible h1:e9Gi/LP9181HT3gBfSOeSBA+5JfemuE4aEAhqNgoE4k=
 github.com/pingcap/tidb-tools v2.1.3-0.20190116051332-34c808eef588+incompatible/go.mod h1:XGdcy9+yqlDSEMTpOXnwf3hiTeqrV6MN/u1se9N8yIM=
 github.com/pingcap/tipb v0.0.0-20190107072121-abbec73437b7 h1:wnjdQRhybddDesBVBKyOLUPgDaOFdtqA92pduBgWvVQ=


@xiekeyi98

@xiekeyi98

This comment has been minimized.

Copy link
Member

xiekeyi98 commented Mar 6, 2019

@tiancaiamao
Reproduce successfully.
Thank you!

@tiancaiamao

This comment has been minimized.

Copy link
Contributor

tiancaiamao commented Mar 7, 2019

LGTM
We plan to upgrade the CI(after that jenkins-ci should pass) and then merge this PR tomorrow.

@zz-jason
Copy link
Member

zz-jason left a comment

LGTM

@zz-jason zz-jason added status/LGT2 and removed status/LGT1 labels Mar 9, 2019

@zz-jason

This comment has been minimized.

Copy link
Member

zz-jason commented Mar 9, 2019

/run-all-tests

@zhouqiang-cl

This comment has been minimized.

Copy link
Member

zhouqiang-cl commented Mar 9, 2019

/run-all-tests tidb-test=pr/754

@zhouqiang-cl

This comment has been minimized.

Copy link
Member

zhouqiang-cl commented Mar 9, 2019

/run-sqllogic-test tidb-test=pr/754

@zhouqiang-cl

This comment has been minimized.

Copy link
Member

zhouqiang-cl commented Mar 9, 2019

/run-all-tests tidb-test=pr/754

@tiancaiamao tiancaiamao closed this Mar 9, 2019

@tiancaiamao tiancaiamao reopened this Mar 9, 2019

@tiancaiamao tiancaiamao merged commit d672477 into pingcap:master Mar 9, 2019

5 of 6 checks passed

continuous-integration/travis-ci/pr The Travis CI build is in progress
Details
ci/circleci Your tests passed on CircleCI!
Details
idc-jenkins-ci-tidb/build Jenkins job succeeded.
Details
idc-jenkins-ci-tidb/check_dev Jenkins job succeeded.
Details
idc-jenkins-ci-tidb/code_coverage Jenkins job succeeded.
Details
license/cla Contributor License Agreement is signed.
Details

@yangwenmai yangwenmai deleted the yangwenmai:upgrade_go_version branch Mar 9, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.