Skip to content

Cleanup serving stale while origin server down#13083

Open
masaori335 wants to merge 3 commits intoapache:masterfrom
masaori335:asf-master-stale-while-down
Open

Cleanup serving stale while origin server down#13083
masaori335 wants to merge 3 commits intoapache:masterfrom
masaori335:asf-master-stale-while-down

Conversation

@masaori335
Copy link
Copy Markdown
Contributor

@masaori335 masaori335 commented Apr 10, 2026

HttpTransact::HandleCacheOpenReadHit try to return stale contents by checking is_server_negative_cached(s), but actually, this is dead code. Because when all origin servers are marked down, HttpTransact::OSDNSLookup serves stale contents.

This PR marked as draft because new AuTest depends on #13069. (update: this is ready)

@masaori335 masaori335 added this to the 11.0.0 milestone Apr 10, 2026
@masaori335 masaori335 self-assigned this Apr 10, 2026
@masaori335 masaori335 force-pushed the asf-master-stale-while-down branch from bfc2ef4 to 4eaac41 Compare April 12, 2026 23:36
@masaori335 masaori335 force-pushed the asf-master-stale-while-down branch from 4eaac41 to c198907 Compare April 17, 2026 04:33
@masaori335 masaori335 marked this pull request as ready for review April 17, 2026 04:33
@masaori335 masaori335 requested a review from Copilot April 20, 2026 05:07
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR removes unreachable stale-serving logic in HttpTransact::HandleCacheOpenReadHit() and relies on the existing origin-selection/DNS path for serving stale when origins are unavailable, with a new AuTest to cover the “origin down” case and a small documentation update.

Changes:

  • Remove dead code in HttpTransact::HandleCacheOpenReadHit() related to origin negative-caching stale serve.
  • Add a new cache replay test validating stale serving while the origin is marked down, and register it in the cache gold test.
  • Expand the proxy.config.http.down_server.cache_time documentation to mention stale serving behavior.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
src/proxy/http/HttpTransact.cc Removes unreachable origin-negative-cache stale-serve branch; keeps parent-down stale behavior.
tests/gold_tests/cache/replay/proxy_serve_stale_origin_down.replay.yaml New replay that caches an object, marks origin down, verifies stale serve, then revalidation.
tests/gold_tests/cache/proxy_serve_stale.test.py Registers the new replay under the existing cache stale-serving gold test.
doc/admin-guide/files/records.yaml.en.rst Adds explanatory text for down-server cache time behavior.

Comment thread tests/gold_tests/cache/replay/proxy_serve_stale_origin_down.replay.yaml Outdated
Comment thread doc/admin-guide/files/records.yaml.en.rst Outdated
Comment thread tests/gold_tests/cache/replay/proxy_serve_stale_origin_down.replay.yaml Outdated
@bryancall bryancall self-requested a review April 20, 2026 22:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

2 participants