Skip to content
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

egressgateway: Use UID to identify CiliumEndpoints in epDataStore #29124

Merged
merged 1 commit into from
Nov 13, 2023

Conversation

rastislavs
Copy link
Contributor

@rastislavs rastislavs commented Nov 13, 2023

To address a potential race condition demonstrated by a unit test added as part of this change, this changes internal type of the endpointID used to identify CiliumEndpoints in the EGW Manager's epDataStore from NamespacedName to UID.

The race fixed by this change may be triggered during statefulset pod restart/migration to a different node, when a new endpoint may co-exist with the to-be-deleted endpoint with the same NamespacedName for a short period of time. To not break EGW Manager's endpoint event handling, these two need to have unique endpointID, which can be satisfied by relying on the UID.

The drawback of using UID is incompatibility with CiliumEndpointSlices, which is however not an issue for the EGW, as it is already incompatible. In the future the EGW will probably move away from relying on CiliumEndpoints altogether, which should remove this limitation.

To address a potential race condition demonstrated by a unit test
added as part of this change, this changes internal type of the endpointID
used to identify CiliumEndpoints in the EGW Manager's epDataStore
from NamespacedName to UID.

The race fixed by this change can be triggered during statefulset pod
restart/migration to a different node, when a new endpoint may co-exist
with the to-be-deleted endpoint with the same NamespacedName for a short
period of time. To not break EGW Manager's endpoint event handling, these two
need to have unique endpointID, which can be satisfied by relying on the UID.

The drawback of using UID is incompatibility with CiliumEndpointSlices,
which is however not an issue for the EGW, as it is already incompatible.
In the future the EGW will probably move away from relying on
CiliumEndpoints altogether, which should remove this limitation.

Signed-off-by: Rastislav Szabo <rastislav.szabo@isovalent.com>
@maintainer-s-little-helper maintainer-s-little-helper bot added the dont-merge/needs-release-note-label The author needs to describe the release impact of these changes. label Nov 13, 2023
@rastislavs rastislavs added the release-note/bug This PR fixes an issue in a previous release of Cilium. label Nov 13, 2023
@maintainer-s-little-helper maintainer-s-little-helper bot removed the dont-merge/needs-release-note-label The author needs to describe the release impact of these changes. label Nov 13, 2023
@rastislavs rastislavs added feature/egress-gateway Impacts the egress IP gateway feature. kind/bug This is a bug in the Cilium logic. labels Nov 13, 2023
@rastislavs
Copy link
Contributor Author

/test

@rastislavs rastislavs marked this pull request as ready for review November 13, 2023 09:51
@rastislavs rastislavs requested a review from a team as a code owner November 13, 2023 09:51
@rastislavs rastislavs requested a review from jibi November 13, 2023 09:51
@maintainer-s-little-helper maintainer-s-little-helper bot added the ready-to-merge This PR has passed all tests and received consensus from code owners to merge. label Nov 13, 2023
@jibi jibi merged commit e281a99 into cilium:main Nov 13, 2023
62 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature/egress-gateway Impacts the egress IP gateway feature. kind/bug This is a bug in the Cilium logic. ready-to-merge This PR has passed all tests and received consensus from code owners to merge. release-note/bug This PR fixes an issue in a previous release of Cilium.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants