From 5c73758eac4f026dad98710fc9f611031c4b98d1 Mon Sep 17 00:00:00 2001 From: purelind Date: Thu, 31 Aug 2023 17:17:06 +0800 Subject: [PATCH] fix: support for grep non-integer size --- br/tests/br_300_small_tables/run.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/br/tests/br_300_small_tables/run.sh b/br/tests/br_300_small_tables/run.sh index 94de850381cb4..ca257fbce9b5e 100644 --- a/br/tests/br_300_small_tables/run.sh +++ b/br/tests/br_300_small_tables/run.sh @@ -43,7 +43,7 @@ unset BR_LOG_TO_TERM rm -f $BACKUPMETAV2_LOG export GO_FAILPOINTS="github.com/pingcap/tidb/br/pkg/task/progress-call-back=return(\"$PROGRESS_FILE\")" run_br backup db --db "$DB" --log-file $BACKUPMETAV2_LOG -s "local://$TEST_DIR/${DB}v2" --pd $PD_ADDR --use-backupmeta-v2 -backupv2_size=`grep "backup-data-size" "${BACKUPMETAV2_LOG}" | grep -oP '\[\K[^\]]+' | grep "backup-data-size" | awk -F '=' '{print $2}' | grep -oP '\d*\.\d+'` +backupv2_size=`grep "backup-data-size" "${BACKUPMETAV2_LOG}" | grep -oP '\[\K[^\]]+' | grep "backup-data-size" | awk -F '=' '{print $2}' | grep -oP '\d*\.?\d+'` echo "backup meta v2 backup size is ${backupv2_size}" export GO_FAILPOINTS="" @@ -61,7 +61,7 @@ rm -rf $PROGRESS_FILE echo "backup meta v1 start..." rm -f $BACKUPMETAV1_LOG run_br backup db --db "$DB" --log-file $BACKUPMETAV1_LOG -s "local://$TEST_DIR/$DB" --pd $PD_ADDR -backupv1_size=`grep "backup-data-size" "${BACKUPMETAV1_LOG}" | grep -oP '\[\K[^\]]+' | grep "backup-data-size" | awk -F '=' '{print $2}' | grep -oP '\d*\.\d+'` +backupv1_size=`grep "backup-data-size" "${BACKUPMETAV1_LOG}" | grep -oP '\[\K[^\]]+' | grep "backup-data-size" | awk -F '=' '{print $2}' | grep -oP '\d*\.?\d+'` echo "backup meta v1 backup size is ${backupv1_size}" @@ -83,7 +83,7 @@ done rm -rf $RESTORE_LOG echo "restore 1/300 of the table start..." run_br restore table --db $DB --table "sbtest100" --log-file $RESTORE_LOG -s "local://$TEST_DIR/$DB" --pd $PD_ADDR --no-schema -restore_size=`grep "restore-data-size" "${RESTORE_LOG}" | grep -oP '\[\K[^\]]+' | grep "restore-data-size" | awk -F '=' '{print $2}' | grep -oP '\d*\.\d+'` +restore_size=`grep "restore-data-size" "${RESTORE_LOG}" | grep -oP '\[\K[^\]]+' | grep "restore-data-size" | awk -F '=' '{print $2}' | grep -oP '\d*\.?\d+'` echo "restore data size is ${restore_size}" diff=$(calc "$backupv2_size-$restore_size*$TABLES_COUNT")