mirror of
https://github.com/facebook/rocksdb.git
synced 2024-11-30 04:41:49 +00:00
7d36bc4273
Summary: The patch attempts to fix three bugs in `verify_random_db.sh`: 1) https://github.com/facebook/rocksdb/pull/9937 changed the default for `--try_load_options` to true in the script's use case, so we have to explicitly set it to false if the corresponding argument of the script is 0. This should fix the issue we've been seeing with our forward compatibility tests where 7.3 is unable to open a database created by the version on main after adding a new configuration option. 2) The script seems to support two "extra parameters"; however, in practice, if the second one was set, only that one was passed on to `ldb`. Now both get forwarded. 3) When running the `diff` command, the base DB directory was passed as the second argument instead of the file containing the `ldb` output (this actually seems to work, probably accidentally though). Pull Request resolved: https://github.com/facebook/rocksdb/pull/10112 Reviewed By: pdillinger Differential Revision: D36911363 Pulled By: ltamasi fbshipit-source-id: fe29db4e28d373cee51a12322c59050fc50e926d
42 lines
1.2 KiB
Bash
Executable file
42 lines
1.2 KiB
Bash
Executable file
#!/usr/bin/env bash
|
|
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
|
|
#
|
|
# A shell script to verify DB generated by generate_random_db.sh cannot opened and read correct data.
|
|
# ./ldb needs to be avaible to be executed.
|
|
#
|
|
# Usage: <SCRIPT> <DB Path>
|
|
|
|
scriptpath=`dirname $BASH_SOURCE`
|
|
if [ "$#" -lt 2 ]; then
|
|
echo "usage: $BASH_SOURCE <db_directory> <compare_base_db_directory> [dump_file_name] [if_try_load_options] [if_ignore_unknown_options]"
|
|
exit 1
|
|
fi
|
|
|
|
db_dir=$1
|
|
base_db_dir=$2
|
|
dump_file_name=${3:-"dump_file.txt"}
|
|
try_load_options=${4:-"1"}
|
|
ignore_unknown_options=${5:-"0"}
|
|
db_dump=$db_dir"/"$dump_file_name
|
|
base_db_dump=$base_db_dir"/"$dump_file_name
|
|
extra_params=
|
|
|
|
if [ "$try_load_options" = "0" ]; then
|
|
extra_params=" --try_load_options=false"
|
|
elif [ "$try_load_options" = "1" ]; then
|
|
extra_params=" --try_load_options=true"
|
|
fi
|
|
|
|
if [ "$ignore_unknown_options" = "1" ]; then
|
|
extra_params="$extra_params --ignore_unknown_options"
|
|
fi
|
|
|
|
set -e
|
|
echo == Dumping data from $db_dir to $db_dump
|
|
./ldb dump --db=$db_dir $extra_params > $db_dump
|
|
|
|
echo == Dumping data from $base_db_dir to $base_db_dump
|
|
./ldb dump --db=$base_db_dir $extra_params > $base_db_dump
|
|
|
|
diff $db_dump $base_db_dump
|