Skip to content

fix(translator): keep zero-weight backendRefs as clusters to avoid canary cold start - #10467

Open
yuminn-k wants to merge 3 commits into
envoyproxy:mainfrom
yuminn-k:keep-zero-weight-backend-clusters
Open

yuminn-k wants to merge 3 commits into
envoyproxy:mainfrom
yuminn-k:keep-zero-weight-backend-clusters

Conversation

@yuminn-k

@yuminn-k yuminn-k commented Oct 31, 2026 •

Copy link
Copy Markdown

What this PR does / why we need it:

A weight: 0 backendRef on an HTTPRoute or GRPCRoute was dropped from the IR, so its cluster did not exist in xDS until the weight went above 0. With Argo Rollouts or Flagger, the first canary step then pushed CDS/EDS at the same moment traffic started (cold start), and the canary cluster could not be inspected before receiving traffic.

This follows the IR/xDS direction in #10459:

  • IR (internal/gatewayapi/route.go): removed the three zero-weight skips (the processDestination early return, the HTTPRoute/GRPCRoute rule loops, and the processBackendRef early return before merging). Zero-weight destinations now stay in the route's Settings / merged BackendClusters. They add 0 to BackendWeights, so the 500/503 proportions are unchanged and a rule whose refs are all weight 0 still gets the direct 500. With mergeBackends, a weight-0 ref goes through the normal merge/demerge logic.
  • xDS: RouteDestination.NeedsClusterPerSetting now returns true when a setting has weight 0, so the setting gets its own cluster and a weighted_clusters entry with weight: 0. This also means a 100/0 split already uses weighted_clusters, and ramping the canary does not change the route action type. buildWeightedLocalities uses locality weight 1 for a zero-weight setting, because Envoy rejects LocalityLbEndpoints.load_balancing_weight < 1.

Things reviewers may want to check:

  • A weight-0 dynamic resolver ref is still skipped. It has no cluster to warm, and keeping it would trip the "dynamic resolver with multiple backendRefs" 500 for rules that work today.
  • TCP/UDP/TLS routes are unchanged. They still filter out weight-0 settings, and their goldens did not change.
  • Weight-0 refs now appear in %BACKEND_REFS% route stat names, which stay the same while the weight is ramped.
  • Users will see extra clusters (egctl config, admin /clusters) for backends that get no traffic yet. This is intended.

Golden changes: mergebackends-http-canary-same-service-zero-weight (from #10458) now has the canary/4000 merged cluster with a route weight of 0, and httproute-rule-with-multiple-backends-and-weights keeps its weight-0 setting. New xDS fixture: http-route-weighted-backend-zero-weight (inline settings and merged backend clusters).

The first commit is zirain's #10458, cherry-picked unchanged with original authorship and sign-off, so this PR rebases cleanly once #10458 merges.

AI disclosure: this change was prepared with Claude Opus 5.5 (Claude Code).

Which issue(s) this PR fixes:

Fixes #10459


PR Checklist

  • Authorship & ownership: Coding agents / AI assistants are welcome, but I have reviewed every change, understand how and why it works, can explain and maintain it, and take full responsibility for this PR. I have not submitted generated output I do not understand.
  • DCO: All commits are signed off (git commit -s). See DCO: Sign your work.
  • API agreed first: N/A: no changes under /api.
  • Required checks pass: make generate gen-check, make lint, and the unit-test/coverage build pass. (Flaky e2e failures are not considered breakages, but gen-check, lint, and coverage MUST pass.)
  • Tests added/updated: New/changed code is covered by appropriate tests. N/A if this PR does not contain code changes.
  • Docs: User-facing changes update the docs, either in this PR or a follow-up PR. N/A if this PR does not contain user-facing changes.
  • Release notes: For any non-trivial change, added a release-note fragment under release-notes/current/<section>/<pr-number>-<slug>.md (see release-notes/current/README.md for sections and naming). N/A if this PR does not contain non-trivial changes.
  • Generated files committed: N/A: no API, Helm chart, or module changes.
  • Scope & compatibility: The PR is reasonably scoped (no unrelated changes) and preserves backward compatibility, or any breaking change is called out above and documented in release-notes/current/breaking_changes/.
  • Codex review: Requested a Codex review and addressed all of its comments.
  • Copilot review: Requested a Copilot review and addressed all of its comments.

🤖 Generated with Claude Code

https://claude.ai/code/session_012bPQTxDmyCAwQaT3PtwxBr

zirain and others added 3 commits October 31, 2026 12:28
…ckendRef

Signed-off-by: zirain <zirain2009@gmail.com>
A weight-0 HTTPRoute/GRPCRoute backendRef was dropped from the IR, so its
cluster was only created when a canary rollout first raised its weight,
pushing CDS/EDS at the same time traffic started.

Keep zero-weight destinations in the route's settings and merged
BackendClusters, without adding them to the BackendWeights sums, and emit
them as zero-weight weighted_clusters entries. A zero-weight setting
always gets its own cluster with a locality weight of 1, since Envoy
rejects a zero locality weight.

Fixes envoyproxy#10459

Assisted-by: Claude Opus 5.5
Signed-off-by: YuMin Kim <yuminkim.dev@gmail.com>
Signed-off-by: YuMin Kim <yuminkim.dev@gmail.com>
Assisted-by: Claude Opus 5.5
@yuminn-k
yuminn-k requested a review from a team as a code owner October 31, 2026 03:34
@netlify

netlify Bot commented Oct 31, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for cerulean-figolla-1f9435 ready!

Name Link
🔨 Latest commit 8cd1052
🔍 Latest deploy log https://app.netlify.com/projects/cerulean-figolla-1f9435/deploys/6ae561c54d747edcd7eecabf
😎 Deploy Preview https://deploy-preview-10467--cerulean-figolla-1f9435.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.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 31, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ⚠️ Failed 2026-10-31T03:35:14.062442Z
We couldn’t complete this review. Comment @codex review to try again.
3d9979d PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@netlify

netlify Bot commented Oct 31, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for cerulean-figolla-1f9435 ready!

Name Link
🔨 Latest commit 3d9979d
🔍 Latest deploy log https://app.netlify.com/projects/cerulean-figolla-1f9435/deploys/6ae561c7d0733085c0fcfc87
😎 Deploy Preview https://deploy-preview-10467--cerulean-figolla-1f9435.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.

This branch has not been deployed

No deployments
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.

Keep zero-weight backendRefs as clusters so canary rollouts don't start cold

2 participants