-
Notifications
You must be signed in to change notification settings - Fork 666
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
Generic_patch: AddRack: Port should be turned as admin up as last change #1930
Comments
[from email thread] Hi @mohamed Ghoneim, The below topic needs vetting by SMEs, @prince Sunny, @neetha John, @guohan Lu Request: Vice versa, whenever it has it up, order it last. Additionally, whenever a patch has only “port – up” but not down, insert a down at the start explicitly. Reason: In the same line, when a port is marked up (like in AddRack case --- Even in the case, where patch does not have other updates for port, as the port admin-status is like a main switch, turning it down at the start & up at the end, will work in all scenarios. Thank you, |
[replying to the email thread i.e. last comment]
This will take care of the 3 scenarios mentioned.
If the patch contains "port-critical" config, then we will inject port down first if the port is not already down. This means the port admin down happened first.
If the patch contains "port-critical" config, we will start by checking if the port is admin down, I think the port is most probably already down. In this case we will just turn it back up after the "port-critical" config. This means the port admin up happened last.
Identifying port-critical changes
|
#### What I did Fixes #1930 Issue can be summarized into these 2 case: * A patch can contain an operation to turn port `admin up` -- do at the end * A patch that modifies config that needs the port to be down -- start by bringing the port down then do the update then bring it back up #### How I did it The configs that need the port to be down, we will call them `critical-port` configs. * Added a move validator to validate `critical-port` configs, which does the following * If a port is up, make sure the move does not make changes to related `critical-port` configs * If the move is turning a port up, make sure there is no `critical-port` config are still left in the patch * Added a move extender to `critical-port` changes: * If a port is up, bring down if there are critical-port changes * If the move is turning a port up, flip it to down if there are still `critical-port` configs left. In other words, do not turn the port back up until all `critical-port` changes are in done. #### How to verify it * Added `AddRack` unit-test to `tests/generic_config_updater/files/patch_sorter_test_success.json` * Other unit-tests #### Previous command output (if the output of a command-line utility has changed) Check issue #1930 for old sorting order #### New command output (if the output of a command-line utility has changed) Check `AddRack` unit-test to `tests/generic_config_updater/files/patch_sorter_test_success.json` for new sorting-order
Description
In AddRack scenarion where it adds a port and related config, the port should be marked admin-up, only upon completing all other configuration
Steps to reproduce the issue
Describe the results you received
Describe the results you expected
Same as above with exception that line that marked port up should be at the end.
Patch Applier: * [{"op": "add", "path": "/PORT/Ethernet64/admin_status", "value": "up"}]
Additional information you deem important (e.g. issue happens only occasionally)
Sample files to help with repro
issue_repro.tar.gz
The text was updated successfully, but these errors were encountered: