-
Notifications
You must be signed in to change notification settings - Fork 60
AV-232614 Static Route fixes #1705
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
Conversation
36bf02d
to
4433bdb
Compare
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.
Can we add some test case to replicate node error scenario and check behaviour of AKO? Also have we run configmap Ft against the changes to validate all test cases are running fine?
internal/nodes/avi_vrf_translator.go
Outdated
@@ -60,19 +56,36 @@ func (o *AviObjectGraph) BuildVRFGraph(key, vrfName, nodeName string, deleteFlag | |||
node, err := utils.GetInformers().NodeInformer.Lister().Get(nodeName) | |||
if err != nil { | |||
utils.AviLog.Errorf("key: %s, Error in fetching node details: %s: %v", key, nodeName, err) | |||
var staticRouteCopy []*models.StaticRoute | |||
for i := 0; i < len(aviVrfNode.StaticRoutes); i++ { |
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.
This code is replicated at multiple places. Can we make it function and call it?
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.
Changed
4433bdb
to
1bb877c
Compare
548acd9
to
cdd46c1
Compare
} | ||
sort.Strings(nodeNames) | ||
for _, nodeKey := range nodeNames { | ||
o.BuildVRFGraph(key, aviVrfNode.Name, nodeKey, false) |
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.
If node events are happening, through dequeueIngestion, BuildVRFGraph
will be called. This function at the beginning has lock so only one will run. Will be there any conflict ? IF yes, How will we avoid conflict or overwriting of data or some race conditions?
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.
To avoid overwriting data, i have added one more lock within **CheckAndDeduplicateRecords**
function. However, after all the changes in the code, chances are very bleak that this deduplication process will be triggerred and even if it does, it will behave normally the way simultaneous update on multiple nodes is handled.
Please let me know if there is any specific case where, my theoretical assumption will fail
bd41b20
to
bcdf957
Compare
build ako |
internal/nodes/dequeue_ingestion.go
Outdated
@@ -889,7 +889,7 @@ func processNodeObj(key, nodename string, sharedQueue *utils.WorkerQueue, fullsy | |||
utils.AviLog.Errorf("key: %s, msg: Error creating vrf graph: %v", key, err) | |||
return | |||
} | |||
|
|||
aviModelGraph.CheckAndDeduplicateRecords(key) |
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.
Lets call this function when it is not fullsync.
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.
Done
for i := 0; i < len(aviVrfNode.StaticRoutes); i++ { | ||
_, ok := podCidrNextHopMap[*aviVrfNode.StaticRoutes[i].Prefix.IPAddr.Addr] | ||
if ok { | ||
hasDuplicateRecords = true |
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.
We can have a log here mentioning duplicate records are found for the pod cidr
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.
Done
210d393
to
3f5ee43
Compare
build ako |
553f66b
to
fc0a2de
Compare
build ako |
3c02817
to
90d3282
Compare
build ako |
1 similar comment
build ako |
90d3282
to
3d19bbd
Compare
build ako |
1 similar comment
build ako |
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.
Over all changes looks good to me.
3d19bbd
to
a80316d
Compare
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.
LGTM
build ako |
AV-232614 Static Route fixes.
This PR includes following changes: