Skip to content

[v3-3-test] Honor the API server Dag cache TTL when no size limit is set (#71814) - #71845

Open
jason810496 wants to merge 1 commit into
apache:v3-3-testfrom
jason810496:backport-f63d321-v3-3-test
Open

[v3-3-test] Honor the API server Dag cache TTL when no size limit is set (#71814)#71845
jason810496 wants to merge 1 commit into
apache:v3-3-testfrom
jason810496:backport-f63d321-v3-3-test

Conversation

@jason810496

Copy link
Copy Markdown
Member

Setting [api] dag_cache_size = 0 was meant to mean "no size limit," but it silently disabled TTL-based eviction too, ignoring dag_cache_ttl entirely.

Now the TTL applies regardless of size limit, and eviction is only fully disabled when both dag_cache_size and dag_cache_ttl are 0. Deployments using dag_cache_size = 0 will start evicting on the default one-hour TTL; set dag_cache_ttl = 0 to keep the old behavior.

Also included:

  • negative dag_cache_size/dag_cache_ttl values now raise a ValueError instead of being silently clamped (validated both at the API config boundary and defensively in DBDagBag)
  • docs are corrected to show these options shipped in 3.2.2, not 3.3.0, with clarified wording on when TTL refreshes actually happen.

(cherry picked from commit f63d321)

…set (apache#71814)

* Honor the API server Dag cache TTL when no size limit is set

`[api] dag_cache_size = 0` reads as "no size limit", but it selected a mapping
that never evicted at all and silently ignored `[api] dag_cache_ttl`. Age-based
eviction could therefore only be enabled by also accepting a size cap, which is
backwards for a deployment that wants to bound staleness rather than count.

A TTL now applies with or without a size limit, and only setting both options to
0 disables eviction. Deployments on `dag_cache_size = 0` start evicting on the
default hour-long TTL; setting `dag_cache_ttl = 0` restores the old behaviour.

The options were also documented as added in 3.3.0. They shipped in 3.2.2.

* Reject negative API Dag cache values and clarify TTL behavior

Negative cache configuration should fail fast, and operator guidance must reflect that TTL refreshes happen only at revalidation boundaries.

* Reject negative cache values for every DBDagBag caller

Validating at the shared boundary prevents non-API callers from silently clamping invalid cache settings.

* Clarify cache validation context and docs wording

Context-specific errors help operators identify invalid API settings, while defensive constructor checks protect other callers and documentation remains compatible with the spellchecker.

* Clarify API cache TTL documentation layout
(cherry picked from commit f63d321)

Co-authored-by: Jason(Zhe-You) Liu <68415893+jason810496@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant