Skip to content

fix: default httproutes order by creation timestamp or "{namespace}/{name}" combination#6550

Merged
zirain merged 2 commits intoenvoyproxy:mainfrom
fayizk1:httproutes_order_by_ns
Jul 18, 2025
Merged

fix: default httproutes order by creation timestamp or "{namespace}/{name}" combination#6550
zirain merged 2 commits intoenvoyproxy:mainfrom
fayizk1:httproutes_order_by_ns

Conversation

@fayizk1
Copy link
Copy Markdown
Contributor

@fayizk1 fayizk1 commented Jul 17, 2025

What type of PR is this?

fix: default httproutes order by creation timestamp or {namespace}/{name}

Alternative approach to #6433

What this PR does / why we need it:

To ensure consistent HTTP route ordering, this pull request incorporates the route’s “{namespace}/{name}” into the default sorting logic alongside the creation timestamp. It prevents the inconsistent reordering that unrelated updates may trigger (i.e. pod churn, etc.).

Requirements for the GW-API under these circumstances:

  • The oldest Route based on creation timestamp.
  • The Route appearing first in alphabetical order by "{namespace}/{name}". If ties still exist within an HTTPRoute

Which issue(s) this PR fixes:

Fixes #6140

Release Notes: No

@fayizk1 fayizk1 requested a review from a team as a code owner July 17, 2025 20:57
Copy link
Copy Markdown
Contributor

@arkodg arkodg left a comment

Choose a reason for hiding this comment

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

LGTM thanks

@codecov
Copy link
Copy Markdown

codecov bot commented Jul 17, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Please upload report for BASE (main@54588a1). Learn more about missing BASE report.
Report is 4 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #6550   +/-   ##
=======================================
  Coverage        ?   71.08%           
=======================================
  Files           ?      220           
  Lines           ?    37897           
  Branches        ?        0           
=======================================
  Hits            ?    26940           
  Misses          ?     9385           
  Partials        ?     1572           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@arkodg arkodg requested review from a team July 17, 2025 21:40
fayizk1 added 2 commits July 18, 2025 08:57
Signed-off-by: Fayiz Musthafa <fayizk1@gmail.com>
Signed-off-by: Fayiz Musthafa <fayizk1@gmail.com>
@zirain zirain force-pushed the httproutes_order_by_ns branch from 6ce1195 to 79007ae Compare July 18, 2025 00:57
@zirain zirain enabled auto-merge (squash) July 18, 2025 00:57
@zirain zirain merged commit e85bfc3 into envoyproxy:main Jul 18, 2025
28 checks passed
arkodg pushed a commit to arkodg/gateway that referenced this pull request Jul 25, 2025
* leverages the same logic from envoyproxy#6550
and applies it to other places in the gateway-api layer where gateway
api resources were being sorted earlier to make translation order more
deterministic when the creation timestamp is the same

* also add the sort func to GRPCRoute, TLSRoute, TCPRoute and UDPRoute

Signed-off-by: Arko Dasgupta <arko@tetrate.io>
zhaohuabing pushed a commit that referenced this pull request Jul 28, 2025
)

* sort gw api resources based on name if creation timestamp is same

* leverages the same logic from #6550
and applies it to other places in the gateway-api layer where gateway
api resources were being sorted earlier to make translation order more
deterministic when the creation timestamp is the same

* also add the sort func to GRPCRoute, TLSRoute, TCPRoute and UDPRoute

Signed-off-by: Arko Dasgupta <arko@tetrate.io>

* lint

Signed-off-by: Arko Dasgupta <arko@tetrate.io>

---------

Signed-off-by: Arko Dasgupta <arko@tetrate.io>
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.

CPU spikes result from inconsistent route order after each pod restarts

3 participants