Skip to content

Commit

Permalink
[database] save configuration after DB migration (#3143)
Browse files Browse the repository at this point in the history
- Make sure that migrated DB contents persisted for next boot
- Make sure that db saved after warm reboot.

Signed-off-by: Ying Xie <ying.xie@microsoft.com>
  • Loading branch information
yxieca authored Jul 16, 2019
1 parent 33a1b26 commit b5a4527
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions files/build_templates/docker_image_ctl.j2
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,11 @@ function postStartAction()
if [[ -x /usr/bin/db_migrator.py ]]; then
# Migrate the DB to the latest schema version if needed
/usr/bin/db_migrator.py -o migrate

# Save in memory config_db to config_db.json for 2 reasons:
# 1. Persist the DB migration result.
# 2. Save in memory DB after warm reboot.
/usr/bin/config save -y
fi
{%- elif docker_container_name == "swss" %}
docker exec swss rm -f /ready # remove cruft
Expand Down

0 comments on commit b5a4527

Please sign in to comment.