From 87219960651e0c26487d88a97116d22d0c49a10d Mon Sep 17 00:00:00 2001 From: Aaron Gao Date: Thu, 1 Jun 2017 15:42:02 -0700 Subject: [PATCH] add checkpoint support for single db in regression test Summary: For level_compaction_style regression test. Closes https://github.com/facebook/rocksdb/pull/2397 Differential Revision: D5168545 Pulled By: lightmark fbshipit-source-id: 195e4d84917e7c261d9f4fbe9aee5d104c9cb9a2 --- tools/regression_test.sh | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/tools/regression_test.sh b/tools/regression_test.sh index e363cca17..94c76db8b 100755 --- a/tools/regression_test.sh +++ b/tools/regression_test.sh @@ -277,13 +277,21 @@ function build_checkpoint { if ! [ -z "$REMOTE_USER_AT_HOST" ]; then cmd_prefix="$SSH $REMOTE_USER_AT_HOST " fi - dirs=$($cmd_prefix find $ORIGIN_PATH -type d -links 2) - for dir in $dirs; do - db_index=$(basename $dir) - echo "Building checkpoint: $ORIGIN_PATH/$db_index -> $DB_PATH/$db_index ..." - $cmd_prefix $DB_BENCH_DIR/ldb checkpoint --checkpoint_dir=$DB_PATH/$db_index \ - --db=$ORIGIN_PATH/$db_index 2>&1 - done + if [ $NUM_MULTI_DB -gt 1 ]; then + dirs=$($cmd_prefix find $ORIGIN_PATH -type d -links 2) + for dir in $dirs; do + db_index=$(basename $dir) + echo "Building checkpoints: $ORIGIN_PATH/$db_index -> $DB_PATH/$db_index ..." + $cmd_prefix $DB_BENCH_DIR/ldb checkpoint --checkpoint_dir=$DB_PATH/$db_index \ + --db=$ORIGIN_PATH/$db_index 2>&1 + done + else + # checkpoint cannot build in directory already exists + $cmd_prefix rm -rf $DB_PATH + echo "Building checkpoint: $ORIGIN_PATH -> $DB_PATH ..." + $cmd_prefix $DB_BENCH_DIR/ldb checkpoint --checkpoint_dir=$DB_PATH \ + --db=$ORIGIN_PATH 2>&1 + fi } function multiply { -- GitLab