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

service: Restore Maglev table when M changes #14469

Merged
merged 1 commit into from
Jan 5, 2021

Conversation

brb
Copy link
Member

@brb brb commented Dec 21, 2020

When running in the lb-only mode, there is no connectivity to
kube-apiserver, and UpsertService() can be only invoked by the Cilium
API calls.

When cilium-agent restarts, it might recreate the Maglev BPF map if it
detects that the M param might have changed. The recreation removes the
lookup entries from the map leaving the map empty.

As there is no way to resync (with kube-apiserver) after the restart, we
need to fix this by recalculating the Maglev tables during the
restoration of services from the LB BPF maps.

Reported-by: Han Zhou hzhou8@ebay.com

@brb brb added kind/bug This is a bug in the Cilium logic. pending-review labels Dec 21, 2020
@brb brb requested review from borkmann and a team December 21, 2020 16:40
@brb brb requested a review from a team as a code owner December 21, 2020 16:40
@brb brb requested review from a team and michi-covalent December 21, 2020 16:40
@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 Dec 21, 2020
@maintainer-s-little-helper maintainer-s-little-helper bot added this to In progress in 1.10.0 Dec 21, 2020
@brb
Copy link
Member Author

brb commented Dec 21, 2020

test-me-please

Copy link
Member

@christarazi christarazi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, minor question below

pkg/service/service.go Outdated Show resolved Hide resolved
pkg/service/service.go Outdated Show resolved Hide resolved
@brb brb force-pushed the pr/brb/recalc-maglev-after-rm-map branch from 56ed2c8 to 090b024 Compare January 4, 2021 08:50
When running in the lb-only mode, there is no connectivity to
kube-apiserver, and UpsertService() can be only invoked by the Cilium
API calls.

When cilium-agent restarts, it might recreate the Maglev BPF map if it
detects that the M param might have changed. The recreation removes the
lookup entries from the map leaving the map empty.

As there is no way to resync (with kube-apiserver) after the restart, we
need to fix this by recalculating the Maglev tables during the
restoration of services from the LB BPF maps.

Reported-by: Han Zhou <hzhou8@ebay.com>
Signed-off-by: Martynas Pumputis <m@lambda.lt>
@brb
Copy link
Member Author

brb commented Jan 4, 2021

retest-net-next

@brb brb added the release-note/bug This PR fixes an issue in a previous release of Cilium. label Jan 4, 2021
@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 Jan 4, 2021
@brb brb requested a review from christarazi January 4, 2021 09:07
pkg/maps/lbmap/lbmap.go Show resolved Hide resolved
@brb
Copy link
Member Author

brb commented Jan 5, 2021

Previously all tests have passed. After pushing small changes, I ran only net-next which passed. The PR is good to merge.

@aanm aanm merged commit 2b9485d into master Jan 5, 2021
@aanm aanm deleted the pr/brb/recalc-maglev-after-rm-map branch January 5, 2021 14:27
@brb brb added the ready-to-merge This PR has passed all tests and received consensus from code owners to merge. label Jan 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

5 participants