Skip to content

Commit

Permalink
Revert back placement when test is done
Browse files Browse the repository at this point in the history
Signed-off-by: Yang Zhang <yang.zhang@pingcap.com>
  • Loading branch information
v01dstar committed Feb 8, 2023
1 parent 1899385 commit b6f166a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions br/tests/br_replica_read/run.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh
#
# Copyright 2019 PingCAP, Inc.
# Copyright 2023 PingCAP, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -28,6 +28,7 @@ random_store_id=$(run_pd_ctl --pd $PD_ADDR store | jq 'first(.stores[]|select(.s
run_pd_ctl --pd $PD_ADDR store label $random_store_id '$mode' 'read_only'

# set placement rule to add a learner replica for each region in the read only store
run_pd_ctl --pd $PD_ADDR config placement-rules rule-bundle load --out=$TEST_DIR/default_rules.json
cat tests/br_replica_read/placement_rule_with_learner_template.json | jq ".[].rules[0].count = $VOTER_COUNT" > $TEST_DIR/placement_rule_with_learner.json
run_pd_ctl --pd $PD_ADDR config placement-rules rule-bundle save --in $TEST_DIR/placement_rule_with_learner.json

Expand Down Expand Up @@ -82,4 +83,5 @@ run_curl https://$TIDB_STATUS_ADDR/ddl/history | grep -E '/\*from\(br\)\*/CREATE
run_curl https://$TIDB_STATUS_ADDR/ddl/history | grep -E '/\*from\(br\)\*/CREATE DATABASE'

run_sql "DROP DATABASE $DB;"
run_pd_ctl --pd $PD_ADDR store label $random_store_id '$mode' ''
run_pd_ctl --pd $PD_ADDR store label $random_store_id '$mode' ''
run_pd_ctl --pd $PD_ADDR config placement-rules rule-bundle save --in $TEST_DIR/default_rules.json

0 comments on commit b6f166a

Please sign in to comment.