-
Notifications
You must be signed in to change notification settings - Fork 684
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
Remove the CONFIG_DB_INIT flag dependency on db_migrator #2959
Conversation
Signed-off-by: Vivek Reddy Karri <vkarri@nvidia.com>
scripts/db_migrator.py
Outdated
@@ -91,7 +91,9 @@ def __init__(self, namespace, socket=None): | |||
self.asic_type = version_info.get('asic_type') | |||
if not self.asic_type: | |||
log.log_error("ASIC type information not obtained. DB migration will not be reliable") | |||
self.hwsku = device_info.get_hwsku() | |||
|
|||
# TODO: Update get_hwsku API to take in a custom configDB object |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this TODO left? How will custom configDB help unblock the busy wait of get_hwsku?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When get_hwsku() is used, it calls get_localhost_info and it calls ConfigDBConnector.connect() which busy waits. self.configDB is already connected to DB and not hitting the CFG_INIT flag. Ref: https://github.com/sonic-net/sonic-utilities/blob/master/scripts/db_migrator.py#L74
I'll remove the TODO comment
Signed-off-by: Vivek Reddy Karri <vkarri@nvidia.com>
@vivekrnv please update the description with how this change was validated? |
MSFT ADO: 25357782 |
@vivekrnv have you test with 202305? |
With this PR sonic-net/sonic-buildimage#16116, this change is a good to have but not a must |
What I did
db_migrator should not depend on CONFIG_DB_INITIALIZED flag. get_hwsku api call busy waits on that flag
How I did it
Replace get_hwsku call with get_localhost_info call which takes in a custom config_db object
How to verify it
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)