Skip to content

node: Skip equal objects in LocalNodeStore.Update()#30

Draft
jiashengz wants to merge 1 commit into
v1.18from
test/localnode-dedup-v1.18
Draft

node: Skip equal objects in LocalNodeStore.Update()#30
jiashengz wants to merge 1 commit into
v1.18from
test/localnode-dedup-v1.18

Conversation

@jiashengz

Copy link
Copy Markdown

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

Please ensure your pull request adheres to the following guidelines:

  • For first time contributors, read Submitting a pull request
  • All code is covered by unit and/or runtime tests where feasible.
  • All commits contain a well written commit description including a title,
    description and a Fixes: #XXX line if the commit addresses a particular
    GitHub issue.
  • If your commit description contains a Fixes: <commit-id> tag, then
    please add the commit author[s] as reviewer[s] to this issue.
  • All commits are signed off. See the section Developer’s Certificate of Origin
  • Provide a title or release-note blurb suitable for the release notes.
  • Are you a user of Cilium? Please add yourself to the Users doc
  • Thanks for contributing!

Fixes: #issue-number

<!-- Enter the release note text here if needed or remove this section! -->

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant