-
Notifications
You must be signed in to change notification settings - Fork 667
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[db_migrator] Fix migration of Loopback data: handle all Loopback int…
…erfaces (#2560) Fix the issue where cross branch upgrades (base DB version 1_0_1) lead to a OA crash due to a duplicate IP2ME route being added when there are more than one Loopback interfaces. The issue happens as in current implementation lo is hardcoded to be replaced as Loopback0. When the base image's APP DB has more than one IP assigned to lo interface, upon migration, all the IPs are assinged to same loopback Loopback0. This is incorrect, as in newer images different IPs are assinged to distinct Loopback interfaces. How to verify it Verified on a physical testbed that this change fixes the OA crash issue. Also added a unit test to catch this issue in PR tests.
- Loading branch information
Showing
6 changed files
with
113 additions
and
13 deletions.
There are no files selected for viewing
This file contains 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
8 changes: 8 additions & 0 deletions
8
tests/db_migrator_input/appl_db/loopback_interface_migrate_from_1_0_1_expected.json
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"INTF_TABLE:Loopback0" : {"NULL": "NULL"}, | ||
"INTF_TABLE:Loopback0:10.1.0.32/32" : {"NULL": "NULL"}, | ||
"INTF_TABLE:Loopback0:FC00:1::32/128" : {"NULL": "NULL"}, | ||
"INTF_TABLE:Loopback1" : {"NULL": "NULL"}, | ||
"INTF_TABLE:Loopback1:10.20.8.199/32" : {"NULL": "NULL"}, | ||
"INTF_TABLE:Loopback1:2001:506:28:500::1/128" : {"NULL": "NULL"} | ||
} |
18 changes: 18 additions & 0 deletions
18
tests/db_migrator_input/appl_db/loopback_interface_migrate_from_1_0_1_input.json
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"INTF_TABLE:lo:10.1.0.32/32" : { | ||
"scope": "global", | ||
"family": "IPv4" | ||
}, | ||
"INTF_TABLE:lo:FC00:1::32/128" : { | ||
"scope": "global", | ||
"family": "IPv6" | ||
}, | ||
"INTF_TABLE:lo:10.20.8.199/32" : { | ||
"scope": "global", | ||
"family": "IPv4" | ||
}, | ||
"INTF_TABLE:lo:2001:506:28:500::1/128" : { | ||
"scope": "global", | ||
"family": "IPv6" | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
tests/db_migrator_input/config_db/loopback_interface_migrate_from_1_0_1_expected.json
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"LOOPBACK_INTERFACE|Loopback0" : {"NULL": "NULL"}, | ||
"LOOPBACK_INTERFACE|Loopback0|10.1.0.32/32" : {"NULL": "NULL"}, | ||
"LOOPBACK_INTERFACE|Loopback0|FC00:1::32/128" : {"NULL": "NULL"}, | ||
"LOOPBACK_INTERFACE|Loopback1" : {"NULL": "NULL"}, | ||
"LOOPBACK_INTERFACE|Loopback1|10.20.8.199/32" : {"NULL": "NULL"}, | ||
"LOOPBACK_INTERFACE|Loopback1|2001:506:28:500::1/128" : {"NULL": "NULL"} | ||
} |
7 changes: 7 additions & 0 deletions
7
tests/db_migrator_input/config_db/loopback_interface_migrate_from_1_0_1_input.json
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"LOOPBACK_INTERFACE|Loopback0|10.1.0.32/32" : {"NULL": "NULL"}, | ||
"LOOPBACK_INTERFACE|Loopback0|FC00:1::32/128" : {"NULL": "NULL"}, | ||
"LOOPBACK_INTERFACE|Loopback1|10.20.8.199/32" : {"NULL": "NULL"}, | ||
"LOOPBACK_INTERFACE|Loopback1|2001:506:28:500::1/128" : {"NULL": "NULL"}, | ||
"VERSIONS|DATABASE": {"VERSION": "version_1_0_1"} | ||
} |
This file contains 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