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 go.etcd.io/etcd to fix panic in unit test with go1.14 #755

Merged
merged 2 commits into from
Jul 15, 2020

Conversation

amyangfei
Copy link
Contributor

@amyangfei amyangfei commented Jul 15, 2020

What problem does this PR solve?

Fix panic in unit test with go >= 1.14. ref: etcd-io/bbolt#201

fatal error: checkptr: unsafe pointer conversion

goroutine 124 [running]:
runtime.throw(0x1dee7a4, 0x23)
        /home/tidb/.gvm/gos/go1.14.4/src/runtime/panic.go:1116 +0x72 fp=0xc0001c97a0 sp=0xc0001c9770 pc=0x4678e2
runtime.checkptrAlignment(0xc000116a90, 0x1cd75c0, 0x1)
        /home/tidb/.gvm/gos/go1.14.4/src/runtime/checkptr.go:20 +0xc9 fp=0xc0001c97d0 sp=0xc0001c97a0 pc=0x438b99
go.etcd.io/bbolt.(*Bucket).write(0xc0001c9948, 0x0, 0x0, 0x0)
        /home/tidb/.gvm/pkgsets/go1.14.4/global/pkg/mod/go.etcd.io/bbolt@v1.3.3/bucket.go:624 +0x15c fp=0xc0001c9838 sp=0xc0001c97d0 pc=0x161b4dc
go.etcd.io/bbolt.(*Bucket).CreateBucket(0xc0001280f8, 0x2c836b0, 0x7, 0x7, 0xc0001c9ba8, 0x16d7096, 0xc000156748)
        /home/tidb/.gvm/pkgsets/go1.14.4/global/pkg/mod/go.etcd.io/bbolt@v1.3.3/bucket.go:181 +0x465 fp=0xc0001c99f8 sp=0xc0001c9838 pc=0x1617925
go.etcd.io/bbolt.(*Tx).CreateBucket(...)
        /home/tidb/.gvm/pkgsets/go1.14.4/global/pkg/mod/go.etcd.io/bbolt@v1.3.3/tx.go:108
go.etcd.io/etcd/mvcc/backend.(*batchTx).UnsafeCreateBucket(0xc000125a10, 0x2c836b0, 0x7, 0x7)
        /home/tidb/.gvm/pkgsets/go1.14.4/global/pkg/mod/go.etcd.io/etcd@v0.5.0-alpha.5.0.20191211224106-0dc78a144b31/mvcc/backend/batch_tx.go:72 +0x9c fp=0xc0001c9c28 sp=0xc0001c99f8 pc=0x16487ac
go.etcd.io/etcd/mvcc/backend.(*batchTxBuffered).UnsafeCreateBucket(0xc000125a10, 0x2c836b0, 0x7, 0x7)
        <autogenerated>:1 +0x62 fp=0xc0001c9c58 sp=0xc0001c9c28 pc=0x16547a2
go.etcd.io/etcd/etcdserver/api/membership.mustCreateBackendBuckets(0x20fdf80, 0xc000154d00)
        /home/tidb/.gvm/pkgsets/go1.14.4/global/pkg/mod/go.etcd.io/etcd@v0.5.0-alpha.5.0.20191211224106-0dc78a144b31/etcdserver/api/membership/store.go:166 +0x109 fp=0xc0001c9cf0 sp=0xc0001c9c58 pc=0x16ea779
go.etcd.io/etcd/etcdserver/api/membership.(*RaftCluster).SetBackend(...)
        /home/tidb/.gvm/pkgsets/go1.14.4/global/pkg/mod/go.etcd.io/etcd@v0.5.0-alpha.5.0.20191211224106-0dc78a144b31/etcdserver/api/membership/cluster.go:242
go.etcd.io/etcd/etcdserver.NewServer(0x1dbd3be, 0x7, 0x0, 0x0, 0x0, 0x0, 0xc000154400, 0x1, 0x1, 0xc000154380, ...)
        /home/tidb/.gvm/pkgsets/go1.14.4/global/pkg/mod/go.etcd.io/etcd@v0.5.0-alpha.5.0.20191211224106-0dc78a144b31/etcdserver/server.go:406 +0x6493 fp=0xc0001cb6a0 sp=0xc0001c9cf0 pc=0x1852303
go.etcd.io/etcd/embed.StartEtcd(0xc00014ea00, 0xc00030cb00, 0x0, 0x0)
        /home/tidb/.gvm/pkgsets/go1.14.4/global/pkg/mod/go.etcd.io/etcd@v0.5.0-alpha.5.0.20191211224106-0dc78a144b31/embed/etcd.go:211 +0x11d3 fp=0xc0001cd780 sp=0xc0001cb6a0 pc=0x19fd123
github.com/pingcap/ticdc/pkg/etcd.SetupEmbedEtcd(0xc000116500, 0x20, 0x20, 0x7f9f776dde20, 0xc00006a990, 0x43eb6c)
        /home/tidb/code/ticdc/pkg/etcd/etcd.go:60 +0x33d fp=0xc0001cd8c0 sp=0xc0001cd780 pc=0x1a8f2bd
github.com/pingcap/ticdc/cdc/roles/storage.(*etcdSuite).SetUpTest(0xc000398dc0, 0xc0003e00f0)
        /home/tidb/code/ticdc/cdc/roles/storage/etcd_test.go:48 +0x6c fp=0xc0001cdb18 sp=0xc0001cd8c0 pc=0x1a9154c
runtime.call32(0xc000124ae0, 0xc00013a038, 0xc0001127e0, 0x1000000010)

What is changed and how it works?

upgrade go.etcd.io/etcd to latest

Check List

Tests

  • Unit test
  • Integration test

Code changes

Release note

  • No release note

@amyangfei
Copy link
Contributor Author

/run-integration-tests

@codecov-commenter
Copy link

codecov-commenter commented Jul 15, 2020

Codecov Report

Merging #755 into master will not change coverage.
The diff coverage is n/a.

@@             Coverage Diff             @@
##             master       #755   +/-   ##
===========================================
  Coverage   33.6628%   33.6628%           
===========================================
  Files            92         92           
  Lines         10115      10115           
===========================================
  Hits           3405       3405           
  Misses         6380       6380           
  Partials        330        330           

@zier-one
Copy link
Contributor

/lgtm

@ti-srebot ti-srebot added the status/LGT1 Indicates that a PR has LGTM 1. label Jul 15, 2020
@overvenus
Copy link
Member

/lgtm

@ti-srebot ti-srebot removed the status/LGT1 Indicates that a PR has LGTM 1. label Jul 15, 2020
@ti-srebot ti-srebot added the status/LGT2 Indicates that a PR has LGTM 2. label Jul 15, 2020
@overvenus
Copy link
Member

/merge

@ti-srebot ti-srebot added the status/can-merge Indicates a PR has been approved by a committer. label Jul 15, 2020
@ti-srebot
Copy link
Contributor

/run-all-tests

@overvenus overvenus added DNM and removed status/can-merge Indicates a PR has been approved by a committer. labels Jul 15, 2020
@overvenus
Copy link
Member

CI canceled, need to merge release blocker first.

@amyangfei amyangfei removed the DNM label Jul 15, 2020
@amyangfei
Copy link
Contributor Author

/merge

@ti-srebot ti-srebot added the status/can-merge Indicates a PR has been approved by a committer. label Jul 15, 2020
@overvenus
Copy link
Member

Please make sure it compatible with release-4.0 PD.

@ti-srebot
Copy link
Contributor

/run-all-tests

@amyangfei
Copy link
Contributor Author

/run-integration-tests tidb=release-4.0 tikv=release-4.0 pd=release-4.0

@ti-srebot
Copy link
Contributor

@amyangfei merge failed.

@amyangfei
Copy link
Contributor Author

Please make sure it compatible with release-4.0 PD.

integration test with release-4.0 tidb/tikv/pd works well
https://internal.pingcap.net/idc-jenkins/blue/organizations/jenkins/cdc_ghpr_integration_test/detail/cdc_ghpr_integration_test/1622/pipeline

@amyangfei
Copy link
Contributor Author

/merge

@ti-srebot
Copy link
Contributor

/run-all-tests

@ti-srebot ti-srebot merged commit 108a9bb into pingcap:master Jul 15, 2020
@amyangfei amyangfei deleted the fix-unit-test-go1.14 branch July 15, 2020 14:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants