github.com/pingcap/br@v5.3.0-alpha.0.20220125034240-ec59c7b6ce30+incompatible/tests/lightning_checkpoint_error_destroy/run.sh (about) 1 #!/bin/sh 2 # 3 # Copyright 2019 PingCAP, Inc. 4 # 5 # Licensed under the Apache License, Version 2.0 (the "License"); 6 # you may not use this file except in compliance with the License. 7 # You may obtain a copy of the License at 8 # 9 # http://www.apache.org/licenses/LICENSE-2.0 10 # 11 # Unless required by applicable law or agreed to in writing, software 12 # distributed under the License is distributed on an "AS IS" BASIS, 13 # See the License for the specific language governing permissions and 14 # limitations under the License. 15 16 set -eux 17 18 # Make sure we won't run out of table concurrency by destroying checkpoints 19 20 for i in $(seq 8); do 21 ARGS="--enable-checkpoint=1 --config tests/$TEST_NAME/mysql.toml -d tests/$TEST_NAME/bad-data" 22 set +e 23 run_lightning $ARGS 24 set -e 25 run_lightning_ctl $ARGS -checkpoint-error-destroy=all 26 done 27 28 run_lightning --enable-checkpoint=1 --config "tests/$TEST_NAME/mysql.toml" -d "tests/$TEST_NAME/good-data" 29 run_sql 'SELECT * FROM cped.t' 30 check_contains 'x: 1999-09-09 09:09:09' 31 32 # Try again with the file checkpoints 33 34 run_sql 'DROP DATABASE cped' 35 36 CHECK_POINT_FILE="/tmp/cp_error_destroy.pb" 37 38 # clean up possible old files 39 rm -rf CHECK_POINT_FILE 40 for i in $(seq 8); do 41 ARGS="--enable-checkpoint=1 --config tests/$TEST_NAME/file.toml -d tests/$TEST_NAME/bad-data" 42 set +e 43 run_lightning $ARGS 44 set -e 45 ls -la /tmp/backup_restore_test/importer/.temp/ 46 run_lightning_ctl $ARGS -checkpoint-error-destroy=all 47 ls -la /tmp/backup_restore_test/importer/.temp/ 48 done 49 50 run_lightning --enable-checkpoint=1 --config "tests/$TEST_NAME/file.toml" -d "tests/$TEST_NAME/good-data" 51 run_sql 'SELECT * FROM cped.t' 52 check_contains 'x: 1999-09-09 09:09:09'