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
cmd
.gitignore -rw-r--r-- 38 bytes
Makefile -rw-r--r-- 489 bytes
main.go -rw-r--r-- 256 bytes

back to top