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 old 1911 feature config migration to a new one. #1635

Merged
merged 2 commits into from
Jun 3, 2021

Conversation

stepanblyschak
Copy link
Contributor

This change is in addition to #1522.
The init_cfg.json may have important fields added to configuration, while in
previous fix these entries will not be added when table already exists.
This change fixes this behaviour. Also, in order to preserve users auto_restart
configuration a special logic for migrating CONTAINER_FEATURE table has been implemented.
A test to cover this scenario is added.

Signed-off-by: Stepan Blyschak [email protected]

What I did

Implemented migration for old FEATURE table.

How I did it

Added migrate_feature().

How to verify it

Old 201911 with CONTAINER_FEATURE and old FEATURE schema upgrade to new master.

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)

This change is in addition to sonic-net#1522.
The init_cfg.json may have important fields added to configuration, while in
previous fix these entries will not be added when table already exists.
This change fixes this behaviour. Also, in order to preserve users auto_restart
configuration a special logic for migrating CONTAINER_FEATURE table has been implemented.
A test to cover this scenario is added.

Signed-off-by: Stepan Blyschak <[email protected]>
@liat-grozovik liat-grozovik requested a review from yxieca May 25, 2021 10:37
@liat-grozovik
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

shi-su
shi-su previously approved these changes Jun 1, 2021
Copy link
Contributor

@shi-su shi-su left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

scripts/db_migrator.py Outdated Show resolved Hide resolved
scripts/db_migrator.py Show resolved Hide resolved
scripts/db_migrator.py Show resolved Hide resolved
Signed-off-by: Stepan Blyschak <[email protected]>
@yxieca yxieca merged commit f5f2a00 into sonic-net:master Jun 3, 2021
gitsabari pushed a commit to gitsabari/sonic-utilities that referenced this pull request Jun 15, 2021
…nic-net#1635)

* [db_migrator] fix old 1911 feature config migration to a new one.

This change is in addition to sonic-net#1522.
The init_cfg.json may have important fields added to configuration, while in
previous fix these entries will not be added when table already exists.
This change fixes this behaviour. Also, in order to preserve users auto_restart
configuration a special logic for migrating CONTAINER_FEATURE table has been implemented.
A test to cover this scenario is added.

Signed-off-by: Stepan Blyschak <[email protected]>
raphaelt-nvidia pushed a commit to raphaelt-nvidia/sonic-utilities that referenced this pull request Aug 10, 2021
…nic-net#1635)

* [db_migrator] fix old 1911 feature config migration to a new one.

This change is in addition to sonic-net#1522.
The init_cfg.json may have important fields added to configuration, while in
previous fix these entries will not be added when table already exists.
This change fixes this behaviour. Also, in order to preserve users auto_restart
configuration a special logic for migrating CONTAINER_FEATURE table has been implemented.
A test to cover this scenario is added.

Signed-off-by: Stepan Blyschak <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants