Skip to content

Commit

Permalink
Fix fast-reboot DB migration (sonic-net#2734)
Browse files Browse the repository at this point in the history
Fix DB migrator logic for migrating fast-reboot table, fixing sonic-net#2621 db_migrator.

How I did it
Checking if fast-reboot table exists in DB.

How to verify it
Verified manually, migrating after fast-reboot and after cold/warm reboot.
  • Loading branch information
arfeigin authored and isabelmsft committed Mar 23, 2023
1 parent 16baa1a commit 093c964
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scripts/db_migrator.py
Original file line number Diff line number Diff line change
Expand Up @@ -874,8 +874,8 @@ def version_4_0_0(self):
# reading FAST_REBOOT table can't be done with stateDB.get as it uses hget behind the scenes and the table structure is
# not using hash and won't work.
# FAST_REBOOT table exists only if fast-reboot was triggered.
keys = self.stateDB.keys(self.stateDB.STATE_DB, "FAST_REBOOT")
if keys is not None:
keys = self.stateDB.keys(self.stateDB.STATE_DB, "FAST_REBOOT|system")
if keys:
enable_state = 'true'
else:
enable_state = 'false'
Expand Down

0 comments on commit 093c964

Please sign in to comment.