Remove the CONFIG_DB_INIT flag dependency on db_migrator#2959
Merged
liat-grozovik merged 2 commits intosonic-net:masterfrom Sep 10, 2023
Merged
Remove the CONFIG_DB_INIT flag dependency on db_migrator#2959liat-grozovik merged 2 commits intosonic-net:masterfrom
liat-grozovik merged 2 commits intosonic-net:masterfrom
Conversation
Signed-off-by: Vivek Reddy Karri <[email protected]>
vaibhavhd
reviewed
Aug 29, 2023
scripts/db_migrator.py
Outdated
| 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 |
Contributor
There was a problem hiding this comment.
Why is this TODO left? How will custom configDB help unblock the busy wait of get_hwsku?
Contributor
Author
There was a problem hiding this comment.
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 <[email protected]>
dgsudharsan
approved these changes
Sep 1, 2023
vaibhavhd
approved these changes
Sep 8, 2023
Contributor
|
@vivekrnv please update the description with how this change was validated? |
Contributor
|
MSFT ADO: 25357782 |
JunhongMao
pushed a commit
to JunhongMao/sonic-utilities
that referenced
this pull request
Oct 4, 2023
) - 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 Signed-off-by: Vivek Reddy Karri <[email protected]>
Contributor
|
@vivekrnv have you test with 202305? |
Contributor
Author
|
With this PR sonic-net/sonic-buildimage#16116, this change is a good to have but not a must |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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)