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

Always match the newest store when matching by address #579

Merged
merged 5 commits into from
Jul 8, 2020

Conversation

july2993
Copy link
Contributor

@july2993 july2993 commented Jul 7, 2020

logically, only the store id identify a store.
if normally scale-in a store and scale-out using the same ip:port,
then there's will not only one store with the same address.

before this pr, only some API will match the newest store, this pr make sure all API match the newest store when matching by address.

also, this pr fix the tidbSpec initialize which we must make sure
initiaize the profile dir first.

logically, only the store id identify a store.
if normally scale-in a store and scale-out using the same ip:port,
then there's will not only one store with the same address.

also, this pr fix the tidbSpec initialize which we must make sure
initiaize the profile dir first.
@july2993 july2993 requested a review from lonng July 7, 2020 03:58
@codecov-commenter
Copy link

codecov-commenter commented Jul 7, 2020

Codecov Report

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

Impacted file tree graph

@@             Coverage Diff             @@
##           master     #579       +/-   ##
===========================================
+ Coverage   39.84%   50.54%   +10.69%     
===========================================
  Files         201      219       +18     
  Lines       14847    15888     +1041     
===========================================
+ Hits         5916     8030     +2114     
+ Misses       8072     6738     -1334     
- Partials      859     1120      +261     
Flag Coverage Δ
#coverage 50.54% <ø> (+10.69%) ⬆️
Impacted Files Coverage Δ
...o/src/github.com/pingcap/tiup/server/store/sync.go 28.57% <0.00%> (-28.58%) ⬇️
....com/pingcap/tiup/pkg/cluster/clusterutil/retry.go 50.00% <0.00%> (-17.50%) ⬇️
go/src/github.com/pingcap/tiup/cmd/mirror.go 39.95% <0.00%> (-6.89%) ⬇️
...ingcap/tiup/components/playground/instance/tidb.go 85.36% <0.00%> (-5.34%) ⬇️
...ingcap/tiup/components/playground/instance/tikv.go 75.00% <0.00%> (-4.32%) ⬇️
go/src/github.com/pingcap/tiup/cmd/root.go 60.43% <0.00%> (-3.85%) ⬇️
...pingcap/tiup/components/cluster/command/destroy.go 60.37% <0.00%> (-2.79%) ⬇️
...cap/tiup/components/playground/instance/tiflash.go 61.29% <0.00%> (-2.49%) ⬇️
...om/pingcap/tiup/components/cluster/command/test.go 62.22% <0.00%> (-2.07%) ⬇️
...om/pingcap/tiup/components/cluster/command/root.go 43.39% <0.00%> (-1.88%) ⬇️
... and 122 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c391ff5...758bf36. Read the comment docs.

clusterBaseDir := filepath.Join(profileDir, TiOpsClusterDir)
clusterSpec := meta.NewSpec(clusterBaseDir)
return clusterSpec
tidbSpec = meta.NewSpec(clusterBaseDir)
Copy link
Contributor

Choose a reason for hiding this comment

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

How about putting tidbSpec = meta.NewSpec(clusterBaseDir) into Initialize function directly?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@july2993 july2993 requested a review from lonng July 7, 2020 07:01
Copy link
Contributor

@lonng lonng left a comment

Choose a reason for hiding this comment

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

LGTM

@ti-srebot
Copy link
Contributor

@lonng,Thanks for your review.

@lonng
Copy link
Contributor

lonng commented Jul 8, 2020

/merge

@ti-srebot
Copy link
Contributor

/run-all-tests

@july2993 july2993 merged commit 9d5d61e into pingcap:master Jul 8, 2020
@july2993 july2993 deleted the match branch July 8, 2020 04:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants