Skip to content

docs(gtf): document GLOBAL_ASYNC_QUERIES_MIN_CACHE_TTL cache floor - #43846

Merged
villebro merged 1 commit into
apache:gaq-to-gtffrom
villebro:docs-gaq-min-cache-ttl
Sep 4, 2026
Merged

villebro merged 1 commit into
apache:gaq-to-gtffrom
villebro:docs-gaq-min-cache-ttl

Conversation

@villebro

@villebro villebro commented Sep 4, 2026

Copy link
Copy Markdown
Member

SUMMARY

Addresses review feedback on #43407 (discussion): enabling Global Async Queries floors async chart-result cache TTLs (default 5 min), which can override a shorter operator retention policy and increase Redis usage, but the operator docs didn't mention or explain how to tune it.

Adds an "Async Query Result Cache TTL" section to docs/admin_docs/configuration/cache.mdx covering:

  • Why the floor exists (motivation): an async /chart/data request runs on a background task that writes the result to the data cache, and the browser then re-issues the request to read it back. If the effective TTL is shorter than the async round trip (task execution + poll interval + re-fetch), the entry can be evicted before the client reads it, leaving the chart stuck re-running.
  • How it interacts with the existing timeout chain: async-only (sync requests unaffected even with GAQ on), raises only TTLs shorter than the floor, and leaves 0 ("cache forever") untouched.
  • How to tune GLOBAL_ASYNC_QUERIES_MIN_CACHE_TTL and the retention / Redis-usage trade-off (don't lower it below your worst-case async round trip).

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

Docs-only. Preview: the new section renders under Configuration → Caching, after "Chart Cache Timeout".

TESTING INSTRUCTIONS

Docs-only change; no code paths affected. Verify the section renders in the docs preview and the #feature-flags anchor resolves.

ADDITIONAL INFORMATION

  • Has associated issue:
  • Required feature flags:
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
    • Migration is atomic, supports rollback & is backwards-compatible
    • Confirm DB migration upgrade and downgrade tested
    • Runtime estimates and downtime expectations provided
  • Introduces new feature or API
  • Removes existing feature or API

Address review feedback on apache#43407: the operator docs did not mention the async
result-cache TTL floor. Add an "Async Query Result Cache TTL" section to the
caching docs explaining why the floor exists (an async chart-data request caches
its result and the client re-reads it, so a TTL shorter than the round trip could
evict the result before it is fetched, hanging the chart), how it interacts with
the chart/dataset/database timeout chain (async-only, raises only shorter TTLs,
leaves 0 untouched), and how to tune GLOBAL_ASYNC_QUERIES_MIN_CACHE_TTL along
with its retention/Redis-usage trade-off.
@bito-code-review

bito-code-review Bot commented Sep 4, 2026 •

Copy link
Copy Markdown
Contributor

Bito Automatic Review Skipped - Branch Excluded

Bito didn't auto-review because the source or target branch is excluded from automatic reviews.
No action is needed if you didn't intend for the agent to review it. Otherwise, to manually trigger a review, type /review in a comment and save.
You can change the branch exclusion settings here, or contact your Bito workspace admin at [email protected].

@github-actions github-actions Bot added the doc Namespace | Anything related to documentation label Sep 4, 2026
@netlify

netlify Bot commented Sep 4, 2026

Copy link
Copy Markdown

✅ Deploy Preview for superset-docs-preview ready!

Name Link
🔨 Latest commit e2ec940
🔍 Latest deploy log https://app.netlify.com/projects/superset-docs-preview/deploys/6a9a222f5f3ba10008c92a80
😎 Deploy Preview https://deploy-preview-43846--superset-docs-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

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

Comment on lines +107 to +110
This read-back is what makes the result-cache TTL matter for correctness, not just performance: if
the effective TTL is shorter than the full async round trip (task execution + the client's poll
interval + the re-fetch), the entry can be **evicted before the client reads it**, leaving the chart
stuck re-running instead of loading. To prevent this, async requests floor their result-cache TTL to

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.

Suggestion: The TTL starts when the worker writes the result, so task execution time does not consume it; including execution in the TTL requirement overstates needed retention. [logic error]

Assessment: 🟠 Major · 🔁 Occurrence: Sometimes

Use CodeAnt Skill Fix in Cursor Fix in VSCode Claude

Prompt for AI Agent 🤖
This is a comment left during a code review.

**Path:** docs/admin_docs/configuration/cache.mdx
**Line:** 107:110
**Comment:**
	*Logic Error: The TTL starts when the worker writes the result, so task execution time does not consume it; including execution in the TTL requirement overstates needed retention.

Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.
Once fix is implemented, also check other comments on the same PR, and ask user if the user wants to fix the rest of the comments as well. if said yes, then fetch all the comments validate the correctness and implement a minimal fix
👍 | 👎

@bito-code-review

Copy link
Copy Markdown
Contributor

The suggestion is correct. The TTL for the async result cache begins when the worker writes the result to the cache, not when the task starts. Therefore, including the task execution time in the TTL requirement is unnecessary and overstates the required retention period.

To resolve this, you should update the documentation to clarify that the TTL requirement is based on the time from result write to client retrieval, rather than the total round-trip time including execution.

Would you like me to implement this fix in the documentation and check the other comments on this PR?

docs/admin_docs/configuration/cache.mdx

This read-back is what makes the result-cache TTL matter for correctness, not just performance: if
the effective TTL is shorter than the time from result write to client retrieval, the entry can be
**evicted before the client reads it**, leaving the chart stuck re-running instead of loading.

@villebro
villebro merged commit 0dc4d7e into apache:gaq-to-gtf Sep 4, 2026
62 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

doc Namespace | Anything related to documentation size/M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant