Skip to content

Commit

Permalink
Optimize warm-reboot speed on dumping and rebooting (#380)
Browse files Browse the repository at this point in the history
* Optimize warm-reboot speed on dumping and rebooting

Signed-off-by: Qi Luo <[email protected]>

* Keep wtmp

Signed-off-by: Qi Luo <[email protected]>
  • Loading branch information
qiluo-msft authored and lguohan committed Nov 20, 2018
1 parent 1879fd0 commit e948d02
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions scripts/fast-reboot
Original file line number Diff line number Diff line change
Expand Up @@ -145,17 +145,25 @@ if [[ "$REBOOT_TYPE" = "warm-reboot" ]]; then
mkdir -p $WARM_DIR
# Note: requiring redis-dump-load
# Save applDB in /host/warm-reboot/appl_db.json
$DUMP_CMD -d 0 -o $WARM_DIR/appl_db.json
local pids=()
$DUMP_CMD -d 0 -o $WARM_DIR/appl_db.json &
pids+=($!)
# Save configDB in /host/warm-reboot/config_db.json
$DUMP_CMD -d 4 -o $WARM_DIR/config_db.json
$DUMP_CMD -d 4 -o $WARM_DIR/config_db.json &
pids+=($!)
# Save stateDB (only FDB_TABLE and WARM_RESTART_TABLE) in /host/warm-reboot/state_db.json
# WARNING WARNING WARNING: a trick to dump both FDB_TABLE|* and WARM_RESTA*
# TODO: replace it with readable mechanism to dump multiple key patterns into one single json file
$DUMP_CMD -d 6 -k "[FW][DA][BR][_M][T_][AR][BE][LS][ET][|A]*" -o $WARM_DIR/state_db.json
$DUMP_CMD -d 6 -k "[FW][DA][BR][_M][T_][AR][BE][LS][ET][|A]*" -o $WARM_DIR/state_db.json &
pids+=($!)
# Save asicDB in /host/warm-reboot/asic_db.json
$DUMP_CMD -d 1 -o $WARM_DIR/asic_db.json
$DUMP_CMD -d 1 -o $WARM_DIR/asic_db.json &
pids+=($!)
# Save loglevelDB in /host/warm-reboot/loglevel_db.json
$DUMP_CMD -d 3 -o $WARM_DIR/loglevel_db.json
$DUMP_CMD -d 3 -o $WARM_DIR/loglevel_db.json &
pids+=($!)

wait ${pids[@]}
fi

# Kill other containers to make the reboot faster
Expand Down

0 comments on commit e948d02

Please sign in to comment.