Skip to content

fix: record conflict failures and fix missing status patch metric - #320

Open
rawadhossain wants to merge 3 commits into
kubernetes-sigs:mainfrom
rawadhossain:fix/failures-metric-conflict-exhaustion
Open

fix: record conflict failures and fix missing status patch metric#320
rawadhossain wants to merge 3 commits into
kubernetes-sigs:mainfrom
rawadhossain:fix/failures-metric-conflict-exhaustion

Conversation

@rawadhossain

@rawadhossain rawadhossain commented Jul 22, 2026

Copy link
Copy Markdown
Member

Description

Adds node_readiness_api_conflicts_total, tracking every conflict and retry across 7 places:

  • adding/removing a taint
  • marking bootstrap done
  • adding/removing the rule finalizer
  • updating a node's status or the whole rule's status.

Earlier it was just logs and most of these conflicts couldn't actually happen. Now that #343 is in, conflicts are real, so bringing the metric to handle them.

What's added

  • node_readiness_api_conflicts_total with all 7 operations, each tested with a real forced conflict.
  • New failure reason RuleStatusRuleSweepConflictExhausted: full rule status update can exhaust its retries under load, and that wasn't tracked before.
  • monitoring.md updated.

Related to Issue #182

Type of Change

/kind feature

Checklist

  • make test passes
  • make lint passes

@kubernetes-prow

Copy link
Copy Markdown

@rawadhossain: The label(s) kind/improvement cannot be applied, because the repository doesn't have them.

Details

In response to this:

Description

This change improves failure observability by recording conflict-specific failure reasons in node_readiness_failures_total and fixing a missing failure metric in the node reconciler.

Previously, conflict exhausted taint operations were recorded as generic taint errors, so it wasn't possible to distinguish them from other patch errors. The rule status patch error path in the node reconciler also logged failures without recording a failure metric.

To fix this:

  • add conflict-specific failure reasons:
  • AddTaintConflictExhausted
  • RemoveTaintConflictExhausted
  • StatusPatchConflictExhausted
  • record status patch failures in the node reconciler
  • add a structured operation field to evaluateRuleForNode error logs
  • update monitoring.md with the new reason label values

Related to Issue #182

Type of Change

/kind improvement

Checklist

  • make test passes
  • make lint passes

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@kubernetes-prow

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: rawadhossain
Once this PR has been reviewed and has the lgtm label, please assign mrunalp for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@netlify

netlify Bot commented Jul 22, 2026

Copy link
Copy Markdown

Deploy Preview for node-readiness-controller ready!

Name Link
🔨 Latest commit 4d3181b
🔍 Latest deploy log https://app.netlify.com/projects/node-readiness-controller/deploys/6a9d2a61b298e50008867005
😎 Deploy Preview https://deploy-preview-320--node-readiness-controller.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@kubernetes-prow
kubernetes-prow Bot requested review from dchen1107 and mrunalp July 22, 2026 19:23
@kubernetes-prow kubernetes-prow Bot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Jul 22, 2026
@kubernetes-prow

Copy link
Copy Markdown

Hi @rawadhossain. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work.

Tip

We noticed you've done this a few times! Consider joining the org to skip this step and gain /lgtm and other bot rights. We recommend asking approvers on your previous PRs to sponsor you.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@kubernetes-prow kubernetes-prow Bot added needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jul 22, 2026

@AvineshTripathi AvineshTripathi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

left my initial thoughts here!

Comment thread internal/controller/node_controller.go Outdated
Comment thread internal/controller/node_controller.go Outdated
Comment thread internal/controller/nodereadinessrule_controller.go Outdated
Comment thread internal/controller/nodereadinessrule_controller.go Outdated
@AvineshTripathi

Copy link
Copy Markdown
Contributor

cc @Priyankasaggu11929 I remember you had some thoughts on this

@kubernetes-prow kubernetes-prow Bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Aug 5, 2026
@kubernetes-prow kubernetes-prow Bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Aug 22, 2026
@rawadhossain
rawadhossain force-pushed the fix/failures-metric-conflict-exhaustion branch from 9d27a99 to f04128c Compare August 22, 2026 19:06
@kubernetes-prow kubernetes-prow Bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Aug 22, 2026
@rawadhossain

Copy link
Copy Markdown
Member Author

Hi @AvineshTripathi
gave this a fresh look. Actually built api_conflicts_total locally and live tested it to see if it was worth keeping. Most of what it would show either duplicates the ConflictExhausted reasons already in this PR, or just stay at zero where conflicts don't happen.
So I reworked this PR to go with the logs approach instead, which also addresses your earlier comments. PTAL.

@ajaysundark

Copy link
Copy Markdown
Contributor

The largest source of api conflicts (409s) don't rise up because they are handled as merge patch. We should check this after #343 is merged, only after when status conflicts will 'surface'

bhuvan-somisetty added a commit to bhuvan-somisetty/node-readiness-controller that referenced this pull request Aug 22, 2026
Deferred to kubernetes-sigs#320/kubernetes-sigs#288 per review feedback so conflict metrics get handled holistically instead of piecemeal here.
@rawadhossain

Copy link
Copy Markdown
Member Author

cc @ajaysundark for some comments to get holistic context.

@rawadhossain
rawadhossain force-pushed the fix/failures-metric-conflict-exhaustion branch from f04128c to 4d3181b Compare September 6, 2026 08:54
@kubernetes-prow kubernetes-prow Bot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Sep 6, 2026
@rawadhossain

Copy link
Copy Markdown
Member Author

@ajaysundark
added the metric and possible conflict operations. Tested every scenario, and working as expected.
Lmk if any changes needed. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants