-
Notifications
You must be signed in to change notification settings - Fork 537
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
VNET and BGP route coexistence #3345
base: master
Are you sure you want to change the base?
VNET and BGP route coexistence #3345
Conversation
Can you fix coverage? |
/azpw run |
/AzurePipelines run |
Azure Pipelines successfully started running 1 pipeline(s). |
context.vrf_id = gVirtualRouterId; | ||
if (removeRoute(context)) | ||
{ | ||
SWSS_LOG_INFO("Could not find the route with prefix %s", prefix.to_string().c_str()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alignment missing
@@ -989,6 +992,7 @@ bool VNetRouteOrch::selectNextHopGroup(const string& vnet, | |||
// This is followed by an attempt to create a NHG which can be subset of nexthops_primary | |||
// depending on the endpoint monitor state. If no NHG from primary is created, we attempt | |||
// the same for secondary. | |||
SWSS_LOG_NOTICE("Route recieved with monitoring %s and secondary NHG %s.\n",monitoring.c_str(), nexthops_secondary.to_string().c_str()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
recieved typo. Also this may be frequent, suggest to change to INFO
if (failed) | ||
{ | ||
// This is an unrecoverable error, Throw a LOG_ERROR and return | ||
SWSS_LOG_ERROR("Inconsistant Hardware State. Failed to create tunnel routes\n"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo
ipPrefixsubnet.to_string().c_str()); | ||
if (gRouteOrch && !gRouteOrch->removeRouteIfExists(ipPrefixsubnet)) | ||
{ | ||
SWSS_LOG_ERROR("Couldn't Removed existing bgp route for prefix : %s\n", ipPrefixsubnet.to_string().c_str()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove
route_state = ""; | ||
} | ||
} | ||
SWSS_LOG_NOTICE("advertisement of prefix: %s with profile:%s, status: %s via %s\n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Revisit the NOTICE logs, prefer to keep it INFO
auto ipPrefixsubnet = ipPrefix.getSubnet(); | ||
SWSS_LOG_INFO("Attempting to remove BGP learnt route for prefix : %s\n", | ||
ipPrefixsubnet.to_string().c_str()); | ||
if (gRouteOrch && !gRouteOrch->removeRouteIfExists(ipPrefixsubnet)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
check for route existence first
What I did
This PR adds the logic to give Vnet routes precedence over BGP learnt route.
This PR also refactors the test_vnet.py to break out the common code into a library.
Why I did it
Currently if a route is learnt via BGP and added into the hardware, adding a VNET route results in failure. In addition due to a bug in VnetOrch, we start advertising the failed route, This prompts the BGP to remove the learnt route in favor of the local route. Since the Vnet Orch doesn't retry adding the Vnet route, This results in no route being present in the Hardware.
How I verified it
Added 2 tests to verify the learnt route is removed when a Vnet route is added.
One test covers the scnerio where BFD sessions are brought up before the Vnet route is added and the 2nd covers when the Vnet route is added before the BFD sessions are brought up.
Details if related
Tests covering this chage.
sonic-net/sonic-mgmt#15710