playground: Supports the TiKV-CDC component
What problem does this PR solve?
Close #1999: playground: Support component TiKV-CDC.
What is changed and how it works?
Add codes to deal with deploy, scale-in and scale-out of the TiKV-CDC component.
Check List
Tests
- Integration test
- Manual test (add detailed scripts or steps below)
deploy:
❯ bin/tiup-playground v6.2.0 --kvcdc 3 --kvcdc.version=v1.0.0-alpha --db 1 --kv 1 --pd 1 --tiflash 0 --tag clst30 --pd.port 20000
Playground Bootstrapping...
Start pd instance:v6.2.0
Start tikv instance:v6.2.0
Start tidb instance:v6.2.0
Start tikv-cdc instance:v1.0.0-alpha
Start tikv-cdc instance:v1.0.0-alpha
Start tikv-cdc instance:v1.0.0-alpha
Waiting for tidb instances ready
127.0.0.1:38211 ... Done
CLUSTER START SUCCESSFULLY, Enjoy it ^-^
To connect TiDB: mysql --comments --host 127.0.0.1 --port 38211 -u root -p (no password)
To view the dashboard: http://127.0.0.1:20000/dashboard
PD client endpoints: [127.0.0.1:20000]
To view the Prometheus: http://127.0.0.1:34991
To view the Grafana: http://127.0.0.1:39987
❯
❯ ^CPlayground receive signal: interrupt
Wait prometheus(2794768) to quit...
Wait ng-monitoring(2794769) to quit...
Wait grafana(2794849) to quit...
Wait tikv-cdc(2793600) to quit...
Grafana quit
tikv-cdc quit
Wait tikv-cdc(2793601) to quit...
tikv-cdc quit
Wait tikv-cdc(2793611) to quit...
ng-monitoring quit
tikv-cdc quit
Wait tidb(2793599) to quit...
prometheus quit
tidb quit
Wait tikv(2793546) to quit...
tikv quit
Wait pd(2793509) to quit...
pd quit
display, scale-in and scale-out:
❯ bin/tiup-playground display --tag clst30
Pid Role Uptime
--- ---- ------
2670157 pd 29.357248287s
2670173 tikv 29.175895857s
2670180 tidb 29.012693018s
2670233 tikv-cdc 28.543214701s
❯ bin/tiup-playground scale-out --kvcdc 1 --tag clst30
❯ bin/tiup-playground display --tag clst30
Pid Role Uptime
--- ---- ------
2670157 pd 59.749018137s
2670173 tikv 59.567665054s
2670180 tidb 59.40447222s
2670233 tikv-cdc 58.934982488s
2672113 tikv-cdc 8.167426031s
❯ bin/tiup-playground scale-in --pid 2670233 --tag clst30
scale in tikv-cdc success
❯ bin/tiup-playground display --tag clst30
Pid Role Uptime
--- ---- ------
2670157 pd 1m22.054549013s
2670173 tikv 1m21.873198096s
2670180 tidb 1m21.709997698s
2672113 tikv-cdc 30.472933521s
❯ bin/tiup-playground scale-out --kvcdc 3 --tag clst30
❯ bin/tiup-playground display --tag clst30
Pid Role Uptime
--- ---- ------
2670157 pd 1m37.248401925s
2670173 tikv 1m37.067054776s
2670180 tidb 1m36.90385724s
2672113 tikv-cdc 45.666796244s
2672879 tikv-cdc 6.28220083s
2672884 tikv-cdc 6.276836013s
2672889 tikv-cdc 6.271211554s
Code changes
- Has exported variable/fields change
Add Version to instance.Config, to keep version of TiKV-CDC that can be specified by command line argument.
// Config of the instance.
type Config struct {
ConfigPath string `yaml:"config_path"`
BinPath string `yaml:"bin_path"`
Num int `yaml:"num"`
Host string `yaml:"host"`
Port int `yaml:"port"`
UpTimeout int `yaml:"up_timeout"`
Version string `yaml:"version"`
}
- Has command line arguments added
--kvcdc int TiKV-CDC instance number
--kvcdc.binpath string TiKV-CDC instance binary path
--kvcdc.config string TiKV-CDC instance configuration file
--kvcdc.version string TiKV-CDC instance version
Side effects
- No.
Related changes
- Need to cherry-pick to the release branch
- Need to update the documentation
Release notes:
Playground supports the TiKV-CDC component.
[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.
Codecov Report
Base: 52.51% // Head: 46.40% // Decreases project coverage by -6.11% :warning:
Coverage data is based on head (
6f5d5a7) compared to base (42b07cb). Patch coverage: 82.02% of modified lines in pull request are covered.
Additional details and impacted files
@@ Coverage Diff @@
## master #2000 +/- ##
==========================================
- Coverage 52.51% 46.40% -6.11%
==========================================
Files 308 308
Lines 35946 36070 +124
==========================================
- Hits 18875 16738 -2137
- Misses 14849 17152 +2303
+ Partials 2222 2180 -42
| Flag | Coverage Δ | |
|---|---|---|
| cluster | 39.71% <ø> (-1.50%) |
:arrow_down: |
| tiup | 14.25% <ø> (ø) |
|
| unittest | ? |
Flags with carried forward coverage won't be shown. Click here to find out more.
| Impacted Files | Coverage Δ | |
|---|---|---|
| components/playground/instance/instance.go | 48.57% <ø> (ø) |
|
| pkg/cluster/spec/instance.go | 70.36% <ø> (+5.12%) |
:arrow_up: |
| components/playground/main.go | 45.74% <56.25%> (-2.31%) |
:arrow_down: |
| components/playground/instance/tikv_cdc.go | 85.00% <85.00%> (ø) |
|
| components/playground/playground.go | 44.27% <90.00%> (-5.10%) |
:arrow_down: |
| components/playground/command.go | 79.59% <100.00%> (+0.43%) |
:arrow_up: |
| components/dm/ansible/worker.go | 0.00% <0.00%> (-100.00%) |
:arrow_down: |
| ...onents/playground/instance/tiflash_proxy_config.go | 0.00% <0.00%> (-80.00%) |
:arrow_down: |
| pkg/meta/err.go | 0.00% <0.00%> (-76.19%) |
:arrow_down: |
| pkg/cluster/api/error.go | 0.00% <0.00%> (-75.00%) |
:arrow_down: |
| ... and 71 more |
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.
:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.
@haojinming: Thanks for your review. The bot only counts approvals from reviewers and higher roles in list, but you're still welcome to leave your comments.
In response to this:
LGTM~
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository.
@zeminzhou: Thanks for your review. The bot only counts approvals from reviewers and higher roles in list, but you're still welcome to leave your comments.
In response to this:
LGTM~
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository.
/merge
This pull request has been accepted and is ready to merge.