Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[db_migrator] Fix the broken version chain #3014

Merged
merged 2 commits into from
Oct 19, 2023

Conversation

vivekrnv
Copy link
Contributor

Why I did

Warm Reboot from 202205 -> latest labels is failing because of an extra version that was added to 202205 and that was missing in later branches.

How I did it

Add a placeholder for version 3_0_7 in latest labels

How to verify it

WR from 202205 to 202305 and try running db_migrator

root@r-anaconda-simx-139:/home/admin# db_migrator.py -o migrate
Traceback (most recent call last):
  File "/usr/local/bin/db_migrator.py", line 1133, in main
    result = getattr(dbmgtr, operation)()
  File "/usr/local/bin/db_migrator.py", line 1085, in migrate
    next_version = getattr(self, version)()
AttributeError: 'DBMigrator' object has no attribute 'version_3_0_7'
'DBMigrator' object has no attribute 'version_3_0_7'
usage: db_migrator.py [-h] [-o operation migrate, set_version, get_version] [-s unix socket] [-n asic namespace]

optional arguments:
  -h, --help            show this help message and exit
  -o operation (migrate, set_version, get_version)
                        operation to perform [default: get_version]
  -s unix socket        the unix socket that the desired database listens on
  -n asic namespace     The asic namespace whose DB instance we need to connect

With this change:


root@r-anaconda-simx-139:/home/admin# db_migrator.py -o migrate
root@r-anaconda-simx-139:/home/admin# redis-cli -n 4 hgetall "VERSIONS|DATABASE"
1) "VERSION"
2) "version_4_0_3"

Previous command output (if the output of a command-line utility has changed)

New command output (if the output of a command-line utility has changed)

@vaibhavhd vaibhavhd merged commit d857eb0 into sonic-net:master Oct 19, 2023
5 checks passed
@dgsudharsan
Copy link
Collaborator

@StormLiangMS Can you please cherry-pick this bug fix to 202305? This is required for doing the upgrade tests

@StormLiangMS
Copy link
Contributor

ADO:25592749

StormLiangMS pushed a commit that referenced this pull request Oct 25, 2023
Signed-off-by: Vivek Reddy Karri <vkarri@nvidia.com>

Why I did
Warm Reboot from 202205 -> latest labels is failing because of an extra version that was added to 202205 and that was missing in later branches.

How I did it
Add a placeholder for version 3_0_7 in latest labels

How to verify it
WR from 202205 to 202305 and try running db_migrator
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants