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

Update vendor to the latest and add implementation test for GetPrevRegion #7429

Closed
wants to merge 0 commits into from
Closed

Conversation

arthurkiller
Copy link

@arthurkiller arthurkiller commented Aug 18, 2018

What problem does this PR solve?

Update pd and kv proto to the latest according to tikv/pd#1175, which supply the GetPrevRegion function that is really helpful.

What is changed and how it works?

Run dep ensure to update vendor

dep ensure -update github.com/pingcap/pd
dep ensure -update github.com/pingcap/kvproto

Check List

Tests
I have build this fella locally

arthur@ArthursMacBookPro:~/g/s/g/p/tidb:master$ make
CGO_ENABLED=0 go build   -ldflags '-X "github.com/pingcap/tidb/mysql.TiDBReleaseVersion=v2.1.0-beta-252-ga4ab22f2-dirty" -X "github.com/pingcap/tidb/util/printer.TiDBBuildTS=2018-08-18 06:45:09" -X "github.com/pingcap/tidb/util/printer.TiDBGitHash=a4ab22f2730d0274670b585fec7e058636d7b833" -X "github.com/pingcap/tidb/util/printer.TiDBGitBranch=master" -X "github.com/pingcap/tidb/util/printer.GoVersion=go version go1.10.2 darwin/amd64"' -o bin/tidb-server tidb-server/main.go
Build TiDB Server successfully!
  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)

Code changes

func (c *pdClient) GetPrevRegion(ctx context.Context, key []byte) (*metapb.Region, *metapb.Peer, error) {
     region, peer := c.cluster.GetPrevRegionByKey(key)
     return region, peer, nil
}

Side effects

  • Breaking backward compatibility

Related changes

  • Need to update the documentation
  • Need to be included in the release note

@sre-bot
Copy link
Contributor

sre-bot commented Aug 18, 2018

Hi contributor, thanks for your PR.

This patch needs to be approved by someone of admins. They should reply with "/ok-to-test" to accept this PR for running test automatically.

Gopkg.lock Outdated

[[projects]]
branch = "master"
name = "github.com/pingcap/tidb"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

very strange that tidb contains tidb repo....

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed in 080cf406

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@arthurkiller

The tidb should not be in lock file too.

Maybe you can use dep ensure to remove this?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is incorrect to remove it in lock file manually.

Copy link
Author

@arthurkiller arthurkiller Aug 20, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BTW. I did the same... :(

Maybe auto merge got things wrong

I will clean the work space and do it again

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@liukun4515 are you sure do things above will not add tidb into vendor ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If updating vendor is a troublesome thing for you, we can give a pr to update vendor, and you can implement getPrevregion base on the latest master.
By the way, if TiDB wants to use the getPrevReigon feature, we should add this feature to region_cache.go.

Copy link
Author

@arthurkiller arthurkiller Aug 20, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe it's not the time for me to do contribute.XD

Could you pls put up another PR only update things you mentioned?

Copy link
Author

@arthurkiller arthurkiller Aug 20, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahaa, I get it. I did dep ensure in my local repo without run checkout-pr-branch.sh

so dep add the github.vendor for me.

I will redo again...

@liukun4515
Copy link
Contributor

After updating the vendor, you should run the script ./hack/clean_vendor.sh to clean useless files in vendor.

@arthurkiller
Copy link
Author

arthurkiller commented Aug 20, 2018 via email

@arthurkiller
Copy link
Author

arthurkiller commented Aug 20, 2018 via email

@arthurkiller
Copy link
Author

Ok, I will checkout the vendor .toml and .lock` and run ensure again.

@arthurkiller
Copy link
Author

Done, this time things going well

Gopkg.lock Outdated
revision = "51ce9a71510a58bad5ae66ddd278ef28762a1550"

[[projects]]
name = "github.com/go-sql-driver/mysql"
packages = ["."]
revision = "3955978caca48c1658a4bb7a9c6a0f084e326af3"

[[projects]]
name = "github.com/gogo/protobuf"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we not use gogo now? @tiancaiamao

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think update pd and kvproto should not affect those packages.

Copy link
Author

@arthurkiller arthurkiller Aug 21, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't know what's wrong but each time I run

dep ensure -update github.com/pingcap/pd

the gogo package will be replaced with google/protobuffer

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gopkg.lock Outdated
@@ -172,15 +162,6 @@
packages = ["."]
revision = "7a24ed77b2efb460c1468b7dc917821c66e80e55"

[[projects]]
name = "github.com/opentracing/basictracer-go"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here @tiancaiamao

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's still in use.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@siddontang
Copy link
Member

CI failed @arthurkiller

@sre-bot
Copy link
Contributor

sre-bot commented Aug 21, 2018

Hi contributor, thanks for your PR.

This patch needs to be approved by someone of admins. They should reply with "/ok-to-test" to accept this PR for running test automatically.

@arthurkiller
Copy link
Author

arthurkiller commented Aug 21, 2018

Warning: the following project(s) have [[constraint]] stanzas in Gopkg.toml:

  ✗  github.com/opentracing/basictracer-go

However, these projects are not direct dependencies of the current project:
they are not imported in any .go files, nor are they in the 'required' list in
Gopkg.toml. Dep only applies [[constraint]] rules to direct dependencies, so
these rules will have no effect.

ridiculous

@arthurkiller
Copy link
Author

@tiancaiamao @liukun4515 I think the best way is run the dep update by you guys.

I did not know why I just failed. :(

@siddontang
Copy link
Member

PTAL @liukun4515

@liukun4515
Copy link
Contributor

liukun4515 commented Aug 22, 2018

Do I need to continue this job by updating the vendor? @arthurkiller @siddontang

@arthurkiller
Copy link
Author

@liukun4515 Thats's very nice of you

@arthurkiller
Copy link
Author

@siddontang @tiancaiamao Hey dude. @liukun4515 has do update on his own but unfortunately we get the same results.

R U SURE these dependency is still in use?

@siddontang
Copy link
Member

@liukun4515

You can file another PR

@liukun4515
Copy link
Contributor

liukun4515 commented Aug 23, 2018

The version of tipb is incompatible between tidb and kvproto.
When we update the kvproto in tidb, the version of tipb will be updated depending on the kvproto.
Related pr is tipb and tidb.
This may be the reason for the CI failure.
@arthurkiller
@siddontang
I will solve this problem first.
Thanks @tiancaiamao

@arthurkiller
Copy link
Author

closed via #10152

@sre-bot sre-bot added the contribution This PR is from a community contributor. label Dec 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contribution This PR is from a community contributor.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants