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

cluster: Scale-out action can be divided into 2 #1638

Merged
merged 10 commits into from
Nov 24, 2021

Conversation

srstack
Copy link
Collaborator

@srstack srstack commented Nov 24, 2021

What problem does this PR solve?

What is changed and how it works?

TiUP cluster Scale-out action can be divided into 2

  1. tiup cluster scale-out scale-out.yaml --stage1 # deploy
  2. tiup cluster scale-out --stage2 # start and reload config
    image

When you use stage1 and run successfully, the scale-out file lock will be added, which saves stage1 scale-out topology information.

When the scale-out file lock exists, the following operations cannot be performed:

  • tiup cluster start
  • tiup cluster restart
  • tiup cluster stop
  • tiup cluster reload
  • tiup cluster scale-out [ --stage1 ]
  • tiup cluster scale-in
  • tiup cluster upgrade
  • tiup cluster patch [--offline=false]

image

If you use --stage1 and --stage2 at the same time, scale-out operations will not be divided into 2

tiup cluster scale-out --stage1 --stage2 

is equivalent to

tiup cluster scale-out 

Check List

Tests

  • Manual test (add detailed scripts or steps below)

It is best to run tpcc during the manual test

deploy a new cluster with enable_tls: false

  1. scale-out in one step
 ./tiup-cluster scale-out <cluster-name>  scale-out.yaml 
 ./tiup-cluster display <cluster-name>

 ./tiup-cluster scale-out <cluster-name>  scale-out.yaml  --stage1 --stage1
 ./tiup-cluster display <cluster-name>
  1. scale-out in tow step
 ./tiup-cluster scale-out <cluster-name>  scale-out.yaml --stage1
 ./tiup-cluster display <cluster-name>
 ./tiup-cluster scale-out <cluster-name>  scale-out.yaml --stage2
 ./tiup-cluster display <cluster-name>
  1. scale-out in three step (include patch)
 ./tiup-cluster scale-out <cluster-name>  scale-out.yaml --stage1
 ./tiup-cluster display <cluster-name>

# patch: user pd/tikv/tifalsh and tidb to test
./tiup-cluster patch <cluster-name> /home/pd-v5.4.0-nightly-20211123-linux-amd64.tar.gz -R pd

 ./tiup-cluster scale-out <cluster-name>  scale-out.yaml --stage2
 ./tiup-cluster display <cluster-name>

deploy a new cluster with enable_tls: true

  1. scale-out in one step
 ./tiup-cluster scale-out <cluster-name>  scale-out.yaml 
 ./tiup-cluster display <cluster-name>

 ./tiup-cluster scale-out <cluster-name>  scale-out.yaml  --stage1 --stage1
 ./tiup-cluster display <cluster-name>
  1. scale-out in tow step
 ./tiup-cluster scale-out <cluster-name>  scale-out.yaml --stage1
 ./tiup-cluster display <cluster-name>
 ./tiup-cluster scale-out <cluster-name>  scale-out.yaml --stage2
 ./tiup-cluster display <cluster-name>
  1. scale-out in three step (include patch)
 ./tiup-cluster scale-out <cluster-name>  scale-out.yaml --stage1
 ./tiup-cluster display <cluster-name>

# patch: user pd/tikv/tifalsh and tidb to test
./tiup-cluster patch <cluster-name> /home/pd-v5.4.0-nightly-20211123-linux-amd64.tar.gz -R pd

 ./tiup-cluster scale-out <cluster-name>  scale-out.yaml --stage2
 ./tiup-cluster display <cluster-name>

Code changes

  • Has exported function/method change
  • Has exported variable/fields change
  • Has persistent data change

Side effects

  • Increased code complexity

Related changes

  • Need to update the documentation

Release notes:

## Added parameters
- stage1
`Don't start the new instance after scale-out, need to manually execute cluster scale-out --stage2`
- stage2
`Start the new instance and init config after scale-out --stage1`

@srstack srstack self-assigned this Nov 24, 2021
@ti-chi-bot
Copy link
Member

ti-chi-bot commented Nov 24, 2021

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • AstroProfundis

To complete the pull request process, please ask the reviewers in the list to review by filling /cc @reviewer in the comment.
After your PR has acquired the required number of LGTMs, you can assign this pull request to the committer in the list by filling /assign @committer in the comment to help you merge this pull request.

The full list of commands accepted by this bot can be found here.

Reviewer can indicate their review by submitting an approval review.
Reviewer can cancel approval by submitting a request changes review.

@CLAassistant
Copy link

CLAassistant commented Nov 24, 2021

CLA assistant check
All committers have signed the CLA.

@ti-chi-bot ti-chi-bot requested review from 9547 and lucklove November 24, 2021 03:38
@ti-chi-bot ti-chi-bot added the size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label Nov 24, 2021
@codecov-commenter
Copy link

codecov-commenter commented Nov 24, 2021

Codecov Report

Merging #1638 (5be3b85) into master (ca94426) will increase coverage by 22.76%.
The diff coverage is 33.92%.

❗ Current head 5be3b85 differs from pull request most recent head 3f28796. Consider uploading reports for the commit 3f28796 to get more accurate results
Impacted file tree graph

@@             Coverage Diff             @@
##           master    #1638       +/-   ##
===========================================
+ Coverage   15.59%   38.36%   +22.76%     
===========================================
  Files         151      279      +128     
  Lines       15234    25530    +10296     
===========================================
+ Hits         2376     9795     +7419     
- Misses      12341    14250     +1909     
- Partials      517     1485      +968     
Flag Coverage Δ
cluster 31.13% <33.92%> (?)
dm 26.08% <23.33%> (?)
integrate 38.36% <33.92%> (+22.76%) ⬆️
playground 13.31% <0.00%> (?)
tiup ?
unittest ∅ <ø> (∅)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
pkg/cluster/manager/basic.go 48.38% <0.00%> (ø)
pkg/cluster/manager/deploy.go 69.68% <ø> (ø)
pkg/cluster/manager/patch.go 0.00% <0.00%> (ø)
pkg/cluster/manager/reload.go 57.50% <0.00%> (ø)
pkg/cluster/manager/scale_in.go 46.55% <0.00%> (ø)
pkg/cluster/manager/upgrade.go 53.95% <0.00%> (ø)
pkg/cluster/spec/spec_manager.go 50.00% <29.78%> (+50.00%) ⬆️
pkg/cluster/manager/scale_out.go 37.58% <32.35%> (ø)
components/cluster/command/scale_out.go 84.61% <55.55%> (ø)
pkg/cluster/manager/builder.go 65.50% <57.89%> (ø)
... and 262 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 ca94426...3f28796. Read the comment docs.

components/cluster/command/scale_out.go Outdated Show resolved Hide resolved
pkg/cluster/manager/builder.go Outdated Show resolved Hide resolved
pkg/cluster/manager/scale_out.go Outdated Show resolved Hide resolved
pkg/cluster/manager/scale_out.go Outdated Show resolved Hide resolved
pkg/cluster/manager/scale_out.go Outdated Show resolved Hide resolved
pkg/cluster/spec/spec_manager.go Outdated Show resolved Hide resolved
pkg/cluster/spec/spec_manager.go Outdated Show resolved Hide resolved
pkg/cluster/spec/spec_manager.go Outdated Show resolved Hide resolved
pkg/cluster/spec/spec_manager.go Outdated Show resolved Hide resolved
@srstack srstack modified the milestone: v1.8.0 Nov 24, 2021
@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Nov 24, 2021
@AstroProfundis
Copy link
Contributor

/merge

@ti-chi-bot
Copy link
Member

This pull request has been accepted and is ready to merge.

Commit hash: 3f28796

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Nov 24, 2021
@ti-chi-bot ti-chi-bot merged commit 0ec99bb into pingcap:master Nov 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. status/can-merge Indicates a PR has been approved by a committer. status/LGT1 Indicates that a PR has LGTM 1.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TiUP cluster Scale-out action can be divided into 2 steps
5 participants