https://github.com/cilium/cilium
Revision a7f1eeffc1c63d0557207f780ad453fa177613b7 authored by Jussi Maki on 08 August 2023, 08:52:11 UTC, committed by Jussi Mäki on 06 October 2023, 11:00:38 UTC
Fix double upserts that were caused by store being manipulated without
synchronization with the subscriber queues by processing the deltas
under the resource read-lock and doing the initial key listing for
new subscriber with a write-lock. This way we cannot accidentally
see a key in the store and process it just before the key is queued.

As shown by test case in previous commit, the delete events are retried
with an old incorrect version of the object causing a recreated object
to be deleted.

Fix the deletion retrying by always queueing upserts and deletes by key
and keeping the last known state of objects emitted to the subscriber.
Only emit a delete event if the subscriber has seen its creation and
only use a version of the object that the subscriber has observed.

Fixes: 4101e2c768 ("k8s: Add resource package")
Signed-off-by: Jussi Maki <jussi@isovalent.com>
1 parent 75927f7
History
Tip revision: a7f1eeffc1c63d0557207f780ad453fa177613b7 authored by Jussi Maki on 08 August 2023, 08:52:11 UTC
resource: Fix double upserts on subscribe and retrying of delete events
Tip revision: a7f1eef
File Mode Size
.devcontainer
.github
.nvim
.travis
.vscode
Documentation
api
bpf
bugtool
cilium
cilium-health
clustermesh-apiserver
contrib
daemon
envoy
examples
hack
hubble-relay
images
install
kvstoremesh
operator
pkg
plugins
test
tools
vendor
.authors.aux -rw-r--r-- 416 bytes
.clang-format -rw-r--r-- 7.6 KB
.clomonitor.yml -rw-r--r-- 984 bytes
.gitattributes -rw-r--r-- 887 bytes
.gitignore -rw-r--r-- 1.8 KB
.golangci.yaml -rw-r--r-- 4.1 KB
.mailmap -rw-r--r-- 6.4 KB
.travis.yml -rw-r--r-- 506 bytes
AUTHORS -rw-r--r-- 44.5 KB
CODEOWNERS -rw-r--r-- 25.6 KB
CODE_OF_CONDUCT.md -rw-r--r-- 2.2 KB
CONTRIBUTING.md -rw-r--r-- 691 bytes
FURTHER_READINGS.rst -rw-r--r-- 6.4 KB
LICENSE -rw-r--r-- 11.1 KB
MAINTAINERS.md -rw-r--r-- 4.4 KB
Makefile -rw-r--r-- 38.6 KB
Makefile.defs -rw-r--r-- 6.9 KB
Makefile.docker -rw-r--r-- 7.3 KB
Makefile.quiet -rw-r--r-- 818 bytes
README.rst -rw-r--r-- 19.6 KB
SECURITY.md -rw-r--r-- 1.0 KB
USERS.md -rw-r--r-- 30.6 KB
VERSION -rw-r--r-- 11 bytes
Vagrantfile -rw-r--r-- 14.9 KB
go.mod -rw-r--r-- 12.2 KB
go.sum -rw-r--r-- 127.4 KB
netlify.toml -rw-r--r-- 92 bytes
stable.txt -rw-r--r-- 8 bytes
vagrant_box_defaults.rb -rw-r--r-- 334 bytes

README.rst

back to top