Skip to content

Commit

Permalink
To fix the issue: show_techsupport & saidump errors during testbed te…
Browse files Browse the repository at this point in the history
  • Loading branch information
JunhongMao committed Jun 11, 2024
1 parent 4f0fcaf commit 1de9122
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions syncd/scripts/saidump.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ save_saidump_by_rdb()
import json
with open('$filepath') as json_file:
data = json.load(json_file)
print(data['INSTANCES']['redis']['hostname'], data['INSTANCES']['redis']['port'], data['INSTANCES']['redis']['unix_socket_path'])")
print(data['INSTANCES']['redis']['hostname'], data['INSTANCES']['redis']['port'], data['INSTANCES']['redis']['unix_socket_path'])
json_file.close()")

# split
redis_config=(${redis_config// / })
Expand All @@ -19,19 +20,16 @@ with open('$filepath') as json_file:
local redis_dir=`dirname ${redis_config[2]}`
logger "saidump.sh: hostname:$hostname, port:$port, redis_dir:$redis_dir"

logger "saidump.sh: [1] Config Redis consistency directory."
redis-cli -h $hostname -p $port CONFIG SET dir $redis_dir > /dev/null
logger "saidump.sh: [1] Get the remote backups of RDB file."
redis-cli -h $hostname -p $port --rdb $redis_dir/dump.rdb > /dev/null 2>&1

logger "saidump.sh: [2] SAVE."
redis-cli -h $hostname -p $port SAVE > /dev/null
logger "saidump.sh: [2] Run rdb-cli command to convert the dump files into JSON files."
rdb-cli $redis_dir/dump.rdb json | tee $redis_dir/dump.json > /dev/null

logger "saidump.sh: [3] Run rdb command to convert the dump files into JSON files."
rdb --command json $redis_dir/dump.rdb | tee $redis_dir/dump.json > /dev/null

logger "saidump.sh: [4] Run saidump -r to update the JSON files' format as same as the saidump before. Then we can get the saidump's result in standard output."
logger "saidump.sh: [3] Run saidump -r to update the JSON files' format as same as the saidump before. Then we can get the saidump's result in standard output."
saidump -r $redis_dir/dump.json -m 100

logger "saidump.sh: [5] Clear the temporary files."
logger "saidump.sh: [4] Clear the temporary files."
rm -f $redis_dir/dump.rdb
rm -f $redis_dir/dump.json
}
Expand Down

0 comments on commit 1de9122

Please sign in to comment.