Skip to content

Commit

Permalink
tests/tiup-cluster: add case of tiflash scale-in/out with multi dir
Browse files Browse the repository at this point in the history
  • Loading branch information
9547 committed Nov 2, 2020
1 parent 372d919 commit e032ead
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 0 deletions.
16 changes: 16 additions & 0 deletions tests/tiup-cluster/script/scale_tools.sh
Original file line number Diff line number Diff line change
Expand Up @@ -79,5 +79,21 @@ function scale_tools() {
# make sure grafana dashboards has been set to default (since the full_sale_in_grafana.yaml didn't provide a local dashboards dir)
! tiup-cluster $client exec $name -N $ipprefix.101 --command "grep magic-string-for-test /home/tidb/deploy/grafana-3000/dashboards/tidb.json"

# ensure tiflash's data dir exists
tiup-cluster $client exec $name -N $ipprefix.103 --command "ls /home/tidb/deploy/tiflash-9000/data1"
tiup-cluster $client exec $name -N $ipprefix.103 --command "ls /data/tiflash-data"
echo "start scale in tiflash"
tiup-cluster $client --yes scale-in $name -N $ipprefix.103:9000
tiup-cluster $client display $name | grep Tombstone
echo "start prune tiflash"
yes | tiup-cluster $client prune $name
wait_instance_num_reach $name $total_sub_one $native_ssh
! tiup-cluster $client exec $name -N $ipprefix.103 --command "ls /home/tidb/deploy/tiflash-9000/data1"
! tiup-cluster $client exec $name -N $ipprefix.103 --command "ls /data/tiflash-data"
echo "start scale out tiflash"
topo=./topo/full_scale_in_tiflash.yaml
sed "s/__IPPREFIX__/$ipprefix/g" $topo.tpl > $topo
tiup-cluster $client --yes scale-out $name $topo

tiup-cluster $client _test $name writable
}
1 change: 1 addition & 0 deletions tests/tiup-cluster/topo/full.yaml.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ tikv_servers:
# and binary is more than 1G..
tiflash_servers:
- host: __IPPREFIX__.103
data_dir: "data1,/data/tiflash-data"
# - host: __IPPREFIX__.104
# - host: __IPPREFIX__.105

Expand Down
2 changes: 2 additions & 0 deletions tests/tiup-cluster/topo/full_scale_in_tiflash.yaml.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
tiflash_servers:
- host: __IPPREFIX__.103
8 changes: 8 additions & 0 deletions tests/tiup-cluster/topo/full_tls.yaml.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,14 @@ tikv_servers:
- host: __IPPREFIX__.104
- host: __IPPREFIX__.105

# tiflash eat too much memory
# and binary is more than 1G..
tiflash_servers:
- host: __IPPREFIX__.103
data_dir: "data1,data2"
# - host: __IPPREFIX__.104
# - host: __IPPREFIX__.105

pump_servers:
- host: __IPPREFIX__.103
- host: __IPPREFIX__.104
Expand Down

0 comments on commit e032ead

Please sign in to comment.