-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Update topology mapping Refs on all proxy instance deletions #9589
Conversation
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!
if _, ok := copy.Refs[uid]; !ok { | ||
continue |
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.
I guess this could be done on the entry
so that we skip the deep copy in this case? Probably a minor optimization.
🍒 If backport labels were added before merging, cherry-picking will start automatically. To retroactively trigger a backport after merging, add backport labels and re-run https://circleci.com/gh/hashicorp/consul/312876. |
🍒✅ Cherry pick of commit e50019b onto |
* Insert new upstream/downstream mapping to persist new Refs * Avoid upserting mapping copy if it's a no-op * Add test with panic repro * Avoid deleting up/downstreams from inside memdb iterator * Avoid deleting gateway mappings from inside memdb iterator * Add CHANGELOG entry * Tweak changelog entry Co-authored-by: Paul Banks <banks@banksco.de>
To keep track of upstream/downstream pairings for the mesh topology visualization we keep the mapping stored in memdb. This pairing mapping contains a map with a reference to every proxy ID that contains this pair in its service definition.
As proxy instances are deregistered, this map needs to be updated to remove that reference for the pairing.
Currently that map is not being updated on deletions when the proxy ID being registered is not the last instance for that proxy name.
This PR ensures we persist the new reference map when proxy IDs are deregistered, and fixes the broken assertion in the relevant test.
Fixes: #9566