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

Revert "Fix tiflash not start with newest nightly PD (#902)" #1280

Merged
merged 6 commits into from
Apr 7, 2021
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions components/playground/instance/tiflash.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,7 @@ type scheduleConfig struct {
}

type replicateMaxReplicaConfig struct {
MaxReplicas int `json:"max-replicas"`
EnablePlacementRules string `json:"enable-placement-rules"`
MaxReplicas int `json:"max-replicas"`
}

type replicateEnablePlacementRulesConfig struct {
Expand Down Expand Up @@ -123,8 +122,7 @@ func (inst *TiFlashInstance) Start(ctx context.Context, version utils.Version) e
}
// Update maxReplicas before placement rules so that it would not be overwritten
maxReplicas, err := json.Marshal(replicateMaxReplicaConfig{
MaxReplicas: 1,
EnablePlacementRules: "false",
MaxReplicas: 1,
})
if err != nil {
return err
Expand Down Expand Up @@ -154,7 +152,7 @@ func (inst *TiFlashInstance) Start(ctx context.Context, version utils.Version) e
if err != nil {
return err
}
if version, err = env.GetComponentInstalledVersion("tiflash", version); err != nil {
if version, err = env.DownloadComponentIfMissing("tiflash", version); err != nil {
return err
}
// version may be empty, we will use the latest stable version later in Start cmd.
Expand Down
18 changes: 16 additions & 2 deletions tests/tiup-playground/test_playground.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,16 @@ function kill_all() {
killall -9 grafana-server || true
killall -9 tiup-playground || true
killall -9 prometheus || true
cat $outfile
}

outfile=/tmp/tiup-playground-test.out
tiup-playground v4.0.10 --tiflash 0 > $outfile 2>&1 &
tiup-playground nightly > $outfile 2>&1 &

# wait $outfile generated
sleep 3

trap "kill_all > /dev/null 2>&1" EXIT
trap "kill_all" EXIT

# wait start cluster successfully
timeout 300 grep -q "CLUSTER START SUCCESSFULLY" <(tail -f $outfile)
Expand Down Expand Up @@ -97,4 +98,17 @@ tiup-playground display | grep -E "terminated|exit" | wc -l | grep -q "1"

killall -2 tiup-playground.test || killall -2 tiup-playground

sleep 60

# test restart with same data
tiup-playground nightly > $outfile 2>&1 &

# wait $outfile generated
sleep 3

# wait start cluster successfully
timeout 300 grep -q "CLUSTER START SUCCESSFULLY" <(tail -f $outfile)

cat $outfile | grep ":3930" | grep -q "Done"

echo -e "\033[0;36m<<< Run all test success >>>\033[0m"