Skip to content

Improve route_check to better handle duplicate updates#2884

Closed
lolyu wants to merge 1 commit intosonic-net:masterfrom
lolyu:improve_route_check
Closed

Improve route_check to better handle duplicate updates#2884
lolyu wants to merge 1 commit intosonic-net:masterfrom
lolyu:improve_route_check

Conversation

@lolyu
Copy link
Contributor

@lolyu lolyu commented Jun 21, 2023

What I did

Reason for this PR is that there could be multiple route set updates from ASIC_DB when the mux toggles to standby. This PR aims to improve route_check to handle this situation.

Signed-off-by: Longxiang Lyu lolv@microsoft.com

How I did it

Few updates:

  1. Replace diff_sorted_lists with diff_lists, which is better in handling duplicate entries and executed faster.
  2. Remove redundant sort.
  3. Add UT to cover duplicate updates.

How to verify it

UT and verify on dualtor environment

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)

Reason for this PR is that there could be multiple route set updates
from ASIC_DB when the mux toggles to standby. This PR aims to improve
`route_check` to handle this situation.

Few updates:
1. Replace `diff_sorted_lists` with `diff_lists`, which is better in
handling duplicate entries and it is faster.
2. Remove redundant sort.
3. Add UT to cover duplicate updates.

Signed-off-by: Longxiang Lyu <lolv@microsoft.com>
@prsunny
Copy link
Contributor

prsunny commented Jun 23, 2023

This seems to be a major change to existing script. Need to understand the motivation of this change as we use this script for many different validations? My point is, if its mux related, then handle that specifically instead of a generic change

@lolyu
Copy link
Contributor Author

lolyu commented Jun 25, 2023

This seems to be a major change to existing script. Need to understand the motivation of this change as we use this script for many different validations? My point is, if its mux related, then handle that specifically instead of a generic change

Hi @prsunny, this PR doesn't add the mux validation, This PR aims to improve this script to better handle the duplicated updates and add a UT to validate the duplicated updates scenario.
PR: #2840 covers the mux validation part.

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