Skip to content

[202012] Add support for reconciliation after warm restart (#76)#97

Merged
zjswhhh merged 1 commit intosonic-net:202012from
zjswhhh:cherry_pick_202012
Jul 21, 2022
Merged

[202012] Add support for reconciliation after warm restart (#76)#97
zjswhhh merged 1 commit intosonic-net:202012from
zjswhhh:cherry_pick_202012

Conversation

@zjswhhh
Copy link
Collaborator

@zjswhhh zjswhhh commented Jul 21, 2022

Picking up commit below from master branch:
9044962 Jing Zhang Mon Jul 18 15:38:04 2022 -0700 Add support for reconciliation after warm restart (#76)

#76

Description of PR

Summary:
Fixes # (issue)

This PR is to add support for linkmgrd process reconciliation after warm restart.

sign-off: Jing Zhang zhangjing@microsoft.com

Type of change

  • Bug fix
  • New feature
  • Doc/Design
  • Unit test

Approach

What is the motivation for this PR?

One step of warm reboot procedure for dual ToR is to config the switch into manual mode. Before warm reboot finalizer executes config save, we want to config the switch back into auto mode, so config_db.json will be consistent before and after the reboot.

How did you do it?

  1. When linkmgrd is initializing, get the systemwide warm reboot flag from WARM_RESTART_ENABLE_TABLE. If flag == true, start a reconciliation timer.
  2. Maintenance a mux port count based on MUX_CABLE|PORTNAME count. When one port completes reconciliation, if warm restart flag == true, config it back into auto mode, reduce reconciliation port count by 1.
  3. If reconciliation timer expires or port count == 0, set state to reconciled in WARM_RESTART_TABLE|linkmgrd.

How did you verify/test it?

  1. Unit tests
  2. Tested on dual ToR testbed. Ports were auto mode after warm restart completed. Entry WARM_RESTART_TABLE|linkmgrd was added as expected.

Any platform specific information?

Documentation

Description of PR
Summary:
Fixes # (issue)

This PR is to add support for linkmgrd process reconciliation after warm restart.

sign-off: Jing Zhang zhangjing@microsoft.com

Type of change
 Bug fix
 New feature
 Doc/Design
 Unit test
Approach
What is the motivation for this PR?
One step of warm reboot procedure for dual ToR is to config the switch into manual mode. Before warm reboot finalizer executes config save, we want to config the switch back into auto mode, so config_db.json will be consistent before and after the reboot.

How did you do it?
When linkmgrd is initializing, get the systemwide warm reboot flag from WARM_RESTART_ENABLE_TABLE. If flag == true, start a reconciliation timer.
Maintenance a mux port count based on MUX_CABLE|PORTNAME count. When one port completes reconciliation, if warm restart flag == true, config it back into auto mode, reduce reconciliation port count by 1.
If reconciliation timer expires or port count == 0, set state to reconciled in WARM_RESTART_TABLE|linkmgrd.
How did you verify/test it?
Unit tests
Tested on dual ToR testbed. Ports were auto mode after warm restart completed. Entry WARM_RESTART_TABLE|linkmgrd was added as expected.
@zjswhhh zjswhhh merged commit 1fdf0e6 into sonic-net:202012 Jul 21, 2022
@zjswhhh zjswhhh deleted the cherry_pick_202012 branch July 21, 2022 17:33
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.

3 participants