Fix db_migrator to copy missing values from INIT_CFG to config_db#1209
Merged
prsunny merged 1 commit intosonic-net:masterfrom Nov 6, 2020
Merged
Fix db_migrator to copy missing values from INIT_CFG to config_db#1209prsunny merged 1 commit intosonic-net:masterfrom
prsunny merged 1 commit intosonic-net:masterfrom
Conversation
|
This pull request introduces 1 alert when merging 85508bf into ef5f212 - view on LGTM.com new alerts:
|
Contributor
yxieca
approved these changes
Nov 5, 2020
Contributor
Contributor
Thats right @yxieca , we discussed for this PR #1004. I mentioned this PR to |
Contributor
Author
|
@abdosi can we please cherry pick this for 201911 branch too? |
Contributor
|
@vaibhavhd can we create PR for 201911. |
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
Proposed fix for missing
FEATUREtable during warm-upgrade from 201811to 201911.Fixes: sonic-net/sonic-buildimage#5738
FEATURE table is a part of 201911 image database, but absent in 201811 images. The warm upgrade from 201811 image to 201911 image fails as the feature table is missing in the DB and multiple errors are seen in syslog.
This PR fixes DB_MIGRATOR code to update missing init_cfg tables into config_db.
- How I did it
Iterate through the tables in
/etc/sonic/init_cfg.json, if a table is found missing inconfigDB, update theconfigDBwith the missing table. Otherwise, ignore it, so to avoid overridingconfigDBtables withinit_cfg.- How to verify it
Error is easily reproducible. Manually tested the fix by modifying
db_migratorand issuing themigratecommand.The result is that the
FEATUREtable is updated in the in memory database andshow feature statuscommand starts displaying these features.- 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)