node: Skip equal objects in LocalNodeStore.Update() (1.18.3)#32
Open
jiashengz wants to merge 1 commit into
Open
node: Skip equal objects in LocalNodeStore.Update() (1.18.3)#32jiashengz wants to merge 1 commit into
jiashengz wants to merge 1 commit into
Conversation
Don't emit (and wake up observers) when a mutator produces no change to the local node. This prevents redundant downstream work -- most importantly the nodediscovery CiliumNode resource writes that are triggered on every local node emission. During a Kubernetes apiserver outage those writes fail and the retry path ends in logging.Fatal, crashing the agent. Skipping no-op updates keeps the agent from re-arming that fatal path when nothing actually changed. This is a backport of the dedup behavior from upstream's StateDB-based LocalNodeStore, adapted to the 1.18 stream-based store. Upstream-reference: cilium#41294 Signed-off-by: Jiasheng Zhu <jiashengzhu@roblox.com> Co-authored-by: Cursor <cursoragent@cursor.com> (cherry picked from commit 397a641)
d26aff3 to
4d1a23f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Backport of the
LocalNodeStore.Update()dedup behavior, based directly on the1.18.2release tag (via thebase/v1.18.2base branch) so the diff is the single relevant change.Don't emit (and wake up observers) when a mutator produces no change to the local node. This prevents redundant downstream work -- most importantly the
nodediscoveryCiliumNode resource writes that are triggered on every local node emission. During a Kubernetes apiserver outage those writes fail and the retry path ends inlogging.Fatal, crashing the agent. Skipping no-op updates keeps the agent from re-arming that fatal path when nothing actually changed.This is a backport of the dedup behavior from upstream's StateDB-based
LocalNodeStore, adapted to the 1.18 stream-based store.Upstream-reference: cilium#41294
Changes
pkg/node/local_node_store.go: skipemitwhen the mutator produces no change (DeepEqual).Test plan
Update()calls do not wake observers / trigger CiliumNode writesMade with Cursor