Skip to content
This repository has been archived by the owner on Jul 24, 2024. It is now read-only.

Commit

Permalink
Remove unnecessary speed and concurrent limitation (#1333) (#1345)
Browse files Browse the repository at this point in the history
  • Loading branch information
ti-chi-bot authored Jul 22, 2021
1 parent 2f4dab6 commit 2566c32
Show file tree
Hide file tree
Showing 28 changed files with 35 additions and 36 deletions.
6 changes: 3 additions & 3 deletions tests/br_backup_empty/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ DB="$TEST_NAME"

# backup empty.
echo "backup start..."
run_br --pd $PD_ADDR backup full -s "local://$TEST_DIR/empty_db" --ratelimit 5 --concurrency 4
run_br --pd $PD_ADDR backup full -s "local://$TEST_DIR/empty_db"
if [ $? -ne 0 ]; then
echo "TEST: [$TEST_NAME] failed on backup empty cluster!"
exit 1
Expand All @@ -41,11 +41,11 @@ run_sql "CREATE TABLE $DB.usertable1 ( \
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;"

echo "backup start..."
run_br --pd $PD_ADDR backup full -s "local://$TEST_DIR/empty_table" --ratelimit 5 --concurrency 4
run_br --pd $PD_ADDR backup full -s "local://$TEST_DIR/empty_table"

run_sql "DROP DATABASE $DB;"
echo "restore start..."
run_br --pd $PD_ADDR restore full -s "local://$TEST_DIR/empty_table" --ratelimit 5 --concurrency 4
run_br --pd $PD_ADDR restore full -s "local://$TEST_DIR/empty_table"

# insert one row to make sure table is restored.
run_sql "INSERT INTO $DB.usertable1 VALUES (\"a\", \"b\");"
Expand Down
4 changes: 2 additions & 2 deletions tests/br_backup_version/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ function check_version() {

# backup empty using BR
echo "backup start..."
run_br --pd $PD_ADDR backup full -s "local://$TEST_DIR/br_version_1" --ratelimit 5 --concurrency 4
run_br --pd $PD_ADDR backup full -s "local://$TEST_DIR/br_version_1"
if [ $? -ne 0 ]; then
echo "TEST: [$TEST_NAME] failed on backup empty cluster version!"
exit 1
Expand All @@ -64,7 +64,7 @@ run_sql "INSERT INTO $DB.usertable1 VALUES (\"a\", \"b\");"

# backup tables using BR
echo "backup start..."
run_br --pd $PD_ADDR backup full -s "local://$TEST_DIR/br_version_3" --ratelimit 5 --concurrency 4
run_br --pd $PD_ADDR backup full -s "local://$TEST_DIR/br_version_3"
if [ $? -ne 0 ]; then
echo "TEST: [$TEST_NAME] failed on backup empty cluster version!"
exit 1
Expand Down
2 changes: 1 addition & 1 deletion tests/br_case_sensitive/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ run_sql "INSERT INTO $DB.USERTABLE1 VALUES (\"aa\", \"b\");"

# backup table with upper name
echo "backup start..."
run_br --pd $PD_ADDR backup table --db "$DB" --table "USERTABLE1" -s "local://$TEST_DIR/$DB" --ratelimit 5 --concurrency 4
run_br --pd $PD_ADDR backup table --db "$DB" --table "USERTABLE1" -s "local://$TEST_DIR/$DB"

run_sql "DROP DATABASE $DB;"

Expand Down
2 changes: 1 addition & 1 deletion tests/br_clustered_index/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ clustered_table_count=$(run_sql "\

# backup table
echo "backup start..."
run_br --pd $PD_ADDR backup db -s "local://$TEST_DIR/$DB" --db $DB --ratelimit 5 --concurrency 4
run_br --pd $PD_ADDR backup db -s "local://$TEST_DIR/$DB" --db $DB

# count
echo "count rows..."
Expand Down
2 changes: 1 addition & 1 deletion tests/br_db/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ run_sql "INSERT INTO $DB.usertable2 VALUES (\"c\", \"d\");"
# backup db
echo "backup start..."
export GO_FAILPOINTS="github.com/pingcap/br/pkg/task/progress-call-back=return(\"$PROGRESS_FILE\")"
run_br --pd $PD_ADDR backup db --db "$DB" -s "local://$TEST_DIR/$DB" --ratelimit 5 --concurrency 4
run_br --pd $PD_ADDR backup db --db "$DB" -s "local://$TEST_DIR/$DB"
export GO_FAILPOINTS=""

# check if we use the region unit
Expand Down
2 changes: 1 addition & 1 deletion tests/br_db_online/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ run_sql "INSERT INTO $DB.usertable2 VALUES (\"c\", \"d\");"

# backup db
echo "backup start..."
run_br --pd $PD_ADDR backup db --db "$DB" -s "local://$TEST_DIR/$DB" --ratelimit 5 --concurrency 4
run_br --pd $PD_ADDR backup db --db "$DB" -s "local://$TEST_DIR/$DB"

run_sql "DROP DATABASE $DB;"

Expand Down
2 changes: 1 addition & 1 deletion tests/br_db_online_newkv/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ run_sql "INSERT INTO $DB.usertable2 VALUES (\"c\", \"d\");"

# backup db
echo "backup start..."
run_br --pd $PD_ADDR backup db --db "$DB" -s "local://$TEST_DIR/$DB" --ratelimit 5 --concurrency 4
run_br --pd $PD_ADDR backup db --db "$DB" -s "local://$TEST_DIR/$DB"

run_sql "DROP DATABASE $DB;"

Expand Down
2 changes: 1 addition & 1 deletion tests/br_db_skip/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ run_sql "INSERT INTO $DB.usertable1 VALUES (\"aa\", \"b\");"

# backup db
echo "backup start..."
run_br --pd $PD_ADDR backup db --db "$DB" -s "local://$TEST_DIR/$DB" --ratelimit 5 --concurrency 4
run_br --pd $PD_ADDR backup db --db "$DB" -s "local://$TEST_DIR/$DB"

run_sql "DROP DATABASE $DB;"

Expand Down
2 changes: 1 addition & 1 deletion tests/br_debug_meta/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ row_count_ori=$(run_sql "SELECT COUNT(*) FROM $DB.$TABLE;" | awk '/COUNT/{print

# backup table
echo "backup start..."
run_br --pd $PD_ADDR backup table --db $DB --table $TABLE -s "local://$TEST_DIR/$DB" --ratelimit 5 --concurrency 4
run_br --pd $PD_ADDR backup table --db $DB --table $TABLE -s "local://$TEST_DIR/$DB"

run_sql "DROP DATABASE $DB;"

Expand Down
2 changes: 1 addition & 1 deletion tests/br_full_ddl/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ echo "backup start with stats..."
unset BR_LOG_TO_TERM
cluster_index_before_backup=$(run_sql "show variables like '%cluster%';" | awk '{print $2}')

run_br --pd $PD_ADDR backup full -s "local://$TEST_DIR/$DB" --ratelimit 5 --concurrency 4 --log-file $LOG --ignore-stats=false || cat $LOG
run_br --pd $PD_ADDR backup full -s "local://$TEST_DIR/$DB" --log-file $LOG --ignore-stats=false || cat $LOG
checksum_count=$(cat $LOG | grep "checksum success" | wc -l | xargs)

if [ "${checksum_count}" -lt "1" ];then
Expand Down
2 changes: 1 addition & 1 deletion tests/br_full_index/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ echo "backup start..."
# Do not log to terminal
unset BR_LOG_TO_TERM
# do not backup stats to test whether we can restore without stats.
run_br --pd $PD_ADDR backup full -s "local://$TEST_DIR/$DB" --ignore-stats=true --ratelimit 5 --concurrency 4 --log-file $LOG || cat $LOG
run_br --pd $PD_ADDR backup full -s "local://$TEST_DIR/$DB" --ignore-stats=true --log-file $LOG || cat $LOG
BR_LOG_TO_TERM=1

checksum_count=$(cat $LOG | grep "checksum success" | wc -l | xargs)
Expand Down
2 changes: 1 addition & 1 deletion tests/br_history/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ done
# We expect above DDLs finish within 10s.
# history backup full
echo "backup start..."
run_br --pd $PD_ADDR backup full -s "local://$TEST_DIR/$DB" --ratelimit 5 --concurrency 4 --timeago "10s"
run_br --pd $PD_ADDR backup full -s "local://$TEST_DIR/$DB" --timeago "10s"

# restore full
echo "restore start..."
Expand Down
4 changes: 2 additions & 2 deletions tests/br_incremental/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ row_count_ori_full=$(run_sql "SELECT COUNT(*) FROM $DB.$TABLE;" | awk '/COUNT/{p

# full backup
echo "full backup start..."
run_br --pd $PD_ADDR backup table -s "local://$TEST_DIR/$DB/full" --db $DB -t $TABLE --ratelimit 5 --concurrency 4
run_br --pd $PD_ADDR backup table -s "local://$TEST_DIR/$DB/full" --db $DB -t $TABLE

go-ycsb run mysql -P tests/$TEST_NAME/workload -p mysql.host=$TIDB_IP -p mysql.port=$TIDB_PORT -p mysql.user=root -p mysql.db=$DB

# incremental backup
echo "incremental backup start..."
last_backup_ts=$(run_br validate decode --field="end-version" -s "local://$TEST_DIR/$DB/full" | grep -oE "^[0-9]+")
run_br --pd $PD_ADDR backup table -s "local://$TEST_DIR/$DB/inc" --db $DB -t $TABLE --ratelimit 5 --concurrency 4 --lastbackupts $last_backup_ts
run_br --pd $PD_ADDR backup table -s "local://$TEST_DIR/$DB/inc" --db $DB -t $TABLE --lastbackupts $last_backup_ts
row_count_ori_inc=$(run_sql "SELECT COUNT(*) FROM $DB.$TABLE;" | awk '/COUNT/{print $2}')

run_sql "DROP DATABASE $DB;"
Expand Down
4 changes: 2 additions & 2 deletions tests/br_incremental_ddl/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ done

# full backup
echo "full backup start..."
run_br --pd $PD_ADDR backup table -s "local://$TEST_DIR/$DB/full" --db $DB -t $TABLE --ratelimit 5 --concurrency 4
run_br --pd $PD_ADDR backup table -s "local://$TEST_DIR/$DB/full" --db $DB -t $TABLE
# run ddls
echo "run ddls..."
run_sql "RENAME TABLE ${DB}.${TABLE} to ${DB}.${TABLE}1;"
Expand All @@ -48,7 +48,7 @@ done
# incremental backup
echo "incremental backup start..."
last_backup_ts=$(run_br validate decode --field="end-version" -s "local://$TEST_DIR/$DB/full" | grep -oE "^[0-9]+")
run_br --pd $PD_ADDR backup table -s "local://$TEST_DIR/$DB/inc" --db $DB -t $TABLE --ratelimit 5 --concurrency 4 --lastbackupts $last_backup_ts
run_br --pd $PD_ADDR backup table -s "local://$TEST_DIR/$DB/inc" --db $DB -t $TABLE --lastbackupts $last_backup_ts

run_sql "DROP DATABASE $DB;"
# full restore
Expand Down
4 changes: 2 additions & 2 deletions tests/br_incremental_index/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ done
# full backup
echo "backup full start..."
run_sql "CREATE INDEX idx_c1 ON ${DB}.${TABLE}(c1)"
run_br --pd $PD_ADDR backup full -s "local://$TEST_DIR/$DB/full" --ratelimit 5 --concurrency 4
run_br --pd $PD_ADDR backup full -s "local://$TEST_DIR/$DB/full"
wait
# run ddls
echo "run ddls..."
Expand All @@ -42,7 +42,7 @@ run_sql "ALTER TABLE ${DB}.${TABLE} DROP COLUMN c3;";
# incremental backup
echo "incremental backup start..."
last_backup_ts=$(run_br validate decode --field="end-version" -s "local://$TEST_DIR/$DB/full" | grep -oE "^[0-9]+")
run_br --pd $PD_ADDR backup table -s "local://$TEST_DIR/$DB/inc" --db $DB -t $TABLE --ratelimit 5 --concurrency 4 --lastbackupts $last_backup_ts
run_br --pd $PD_ADDR backup table -s "local://$TEST_DIR/$DB/inc" --db $DB -t $TABLE --lastbackupts $last_backup_ts

run_sql "DROP DATABASE $DB;"
# full restore
Expand Down
4 changes: 2 additions & 2 deletions tests/br_incremental_only_ddl/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ done

# full backup
echo "full backup start..."
run_br --pd $PD_ADDR backup table -s "local://$TEST_DIR/$DB/full" --db $DB -t $TABLE --ratelimit 5 --concurrency 4
run_br --pd $PD_ADDR backup table -s "local://$TEST_DIR/$DB/full" --db $DB -t $TABLE
# run ddls
echo "run ddls..."
run_sql "RENAME TABLE ${DB}.${TABLE} to ${DB}.${TABLE}1;"
Expand All @@ -45,7 +45,7 @@ run_sql "TRUNCATE TABLE ${DB}.${TABLE};"
# incremental backup
echo "incremental backup start..."
last_backup_ts=$(run_br validate decode --field="end-version" -s "local://$TEST_DIR/$DB/full" | grep -oE "^[0-9]+")
run_br --pd $PD_ADDR backup table -s "local://$TEST_DIR/$DB/inc" --db $DB -t $TABLE --ratelimit 5 --concurrency 4 --lastbackupts $last_backup_ts
run_br --pd $PD_ADDR backup table -s "local://$TEST_DIR/$DB/inc" --db $DB -t $TABLE --lastbackupts $last_backup_ts

run_sql "DROP DATABASE $DB;"

Expand Down
4 changes: 2 additions & 2 deletions tests/br_incremental_same_table/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ done

# full backup
echo "full backup start..."
run_br --pd $PD_ADDR backup full -s "local://$TEST_DIR/$DB/full" --ratelimit 5 --concurrency 4
run_br --pd $PD_ADDR backup full -s "local://$TEST_DIR/$DB/full"
# run ddls

# create 3 databases, each db has one table with same name
Expand All @@ -51,7 +51,7 @@ done
# incremental backup
echo "incremental backup start..."
last_backup_ts=$(run_br validate decode --field="end-version" -s "local://$TEST_DIR/$DB/full" | grep -oE "^[0-9]+")
run_br --pd $PD_ADDR backup full -s "local://$TEST_DIR/$DB/inc" --ratelimit 5 --concurrency 4 --lastbackupts $last_backup_ts
run_br --pd $PD_ADDR backup full -s "local://$TEST_DIR/$DB/inc" --lastbackupts $last_backup_ts

# cleanup env
run_sql "DROP DATABASE $DB;"
Expand Down
2 changes: 1 addition & 1 deletion tests/br_insert_after_restore/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ row_count_ori=$(run_sql "SELECT COUNT(*) FROM $DB.$TABLE;" | awk '/COUNT/{print

# backup full
echo "backup start..."
run_br --pd $PD_ADDR backup full -s "local://$TEST_DIR/$DB" --ratelimit 5 --concurrency 4
run_br --pd $PD_ADDR backup full -s "local://$TEST_DIR/$DB"

run_sql "DROP DATABASE $DB;"

Expand Down
2 changes: 1 addition & 1 deletion tests/br_key_locked/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ bin/locker \

# backup table
echo "backup start..."
run_br --pd $PD_ADDR backup table -s "local://$TEST_DIR/$DB" --db $DB -t $TABLE --ratelimit 5 --concurrency 4
run_br --pd $PD_ADDR backup table -s "local://$TEST_DIR/$DB" --db $DB -t $TABLE

run_sql "DROP TABLE $DB.$TABLE;"

Expand Down
2 changes: 1 addition & 1 deletion tests/br_move_backup/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ row_count_ori=$(run_sql "SELECT COUNT(*) FROM $DB.$TABLE;" | awk '/COUNT/{print

# backup table
echo "backup start..."
run_br --pd $PD_ADDR backup table -s "local://$TEST_DIR/$DB" --db $DB -t $TABLE --ratelimit 5 --concurrency 4
run_br --pd $PD_ADDR backup table -s "local://$TEST_DIR/$DB" --db $DB -t $TABLE

run_sql "DROP TABLE $DB.$TABLE;"

Expand Down
2 changes: 1 addition & 1 deletion tests/br_other/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ done

# backup full
echo "backup start..."
run_br --pd $PD_ADDR backup full -s "local://$TEST_DIR/$DB" --ratelimit 5 --concurrency 4
run_br --pd $PD_ADDR backup full -s "local://$TEST_DIR/$DB"

# Test debug decode
run_br -s "local://$TEST_DIR/$DB" debug decode --field "Schemas"
Expand Down
1 change: 0 additions & 1 deletion tests/br_s3/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ for p in $(seq 2); do
unset BR_LOG_TO_TERM
( GO_FAILPOINTS="github.com/pingcap/br/pkg/backup/s3-outage-during-writing-file=1*return(\"$sig_file\")" \
run_br --pd $PD_ADDR backup full -s "s3://mybucket/$DB?endpoint=http://$S3_ENDPOINT$S3_KEY" \
--ratelimit 1 \
--log-file $BACKUP_LOG || \
( cat $BACKUP_LOG && BR_LOG_TO_TERM=1 && exit 1 ) ) &
br_pid=$!
Expand Down
2 changes: 1 addition & 1 deletion tests/br_shuffle_leader/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ run_pd_ctl -u https://$PD_ADDR sched add shuffle-leader-scheduler

# backup with shuffle leader
echo "backup start..."
run_br --pd $PD_ADDR backup table -s "local://$TEST_DIR/$DB" --db $DB -t $TABLE --ratelimit 1 --concurrency 4
run_br --pd $PD_ADDR backup table -s "local://$TEST_DIR/$DB" --db $DB -t $TABLE

run_sql "DROP TABLE $DB.$TABLE;"

Expand Down
2 changes: 1 addition & 1 deletion tests/br_shuffle_region/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ run_pd_ctl -u https://$PD_ADDR sched add shuffle-region-scheduler

# backup with shuffle region
echo "backup start..."
run_br --pd $PD_ADDR backup table -s "local://$TEST_DIR/$DB" --db $DB -t $TABLE --ratelimit 1 --concurrency 4
run_br --pd $PD_ADDR backup table -s "local://$TEST_DIR/$DB" --db $DB -t $TABLE

run_sql "DROP TABLE $DB.$TABLE;"

Expand Down
2 changes: 1 addition & 1 deletion tests/br_single_table/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ row_count_ori=$(run_sql "SELECT COUNT(*) FROM $DB.$TABLE;" | awk '/COUNT/{print

# backup table
echo "backup start..."
run_br --pd $PD_ADDR backup table -s "local://$TEST_DIR/$DB" --db $DB -t $TABLE --ratelimit 5 --concurrency 4
run_br --pd $PD_ADDR backup table -s "local://$TEST_DIR/$DB" --db $DB -t $TABLE

run_sql "DROP TABLE $DB.$TABLE;"

Expand Down
2 changes: 1 addition & 1 deletion tests/br_skip_checksum/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ done

# backup full, skipping generate checksum.
echo "backup start..."
run_br --pd $PD_ADDR backup full -s "local://$TEST_DIR/$DB" --ratelimit 5 --concurrency 4 --checksum=false
run_br --pd $PD_ADDR backup full -s "local://$TEST_DIR/$DB" --checksum=false

for i in $(seq $DB_COUNT); do
run_sql "DROP DATABASE $DB${i};"
Expand Down
2 changes: 1 addition & 1 deletion tests/br_split_region_fail/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ done

# backup full
echo "backup start..."
run_br --pd $PD_ADDR backup full -s "local://$TEST_DIR/$DB" --ratelimit 5 --concurrency 4
run_br --pd $PD_ADDR backup full -s "local://$TEST_DIR/$DB"

rm -f $LOG

Expand Down
2 changes: 1 addition & 1 deletion tests/br_table_partition/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ done

# backup full
echo "backup start..."
run_br --pd $PD_ADDR backup full -s "local://$TEST_DIR/$DB" --ratelimit 5 --concurrency 4
run_br --pd $PD_ADDR backup full -s "local://$TEST_DIR/$DB"

run_sql "DROP DATABASE $DB;"

Expand Down

0 comments on commit 2566c32

Please sign in to comment.