Skip to content

fix(query-orchestrator): Return result when refreshKey changes during…#10445

Draft
ovr wants to merge 1 commit intomasterfrom
fix/must-revalidate-refresh-key-issue
Draft

fix(query-orchestrator): Return result when refreshKey changes during…#10445
ovr wants to merge 1 commit intomasterfrom
fix/must-revalidate-refresh-key-issue

Conversation

@ovr
Copy link
Member

@ovr ovr commented Feb 27, 2026

… query execution

When must-revalidate cache mode is used and the refreshKey changes faster than the query executes, queries could enter an endless loop. This fix:

  1. Splits the cache renewal condition into "expired" vs "key mismatch but not expired" — user requests with a key mismatch on non-expired cache now return the cached result immediately with a background refresh instead of blocking.
  2. Prevents pre-aggregation rebuilds when the existing build is recent (within refreshKeyRenewalThreshold) and the structure version hasn't changed.
  3. Adds skipRefreshKeyWaitForRenew to the must-revalidate path to avoid blocking on refresh key re-evaluation.

… query execution

When `must-revalidate` cache mode is used and the refreshKey changes faster
than the query executes, queries could enter an endless loop. This fix:

1. Splits the cache renewal condition into "expired" vs "key mismatch but not
   expired" — user requests with a key mismatch on non-expired cache now return
   the cached result immediately with a background refresh instead of blocking.
2. Prevents pre-aggregation rebuilds when the existing build is recent (within
   refreshKeyRenewalThreshold) and the structure version hasn't changed.
3. Adds skipRefreshKeyWaitForRenew to the must-revalidate path to avoid
   blocking on refresh key re-evaluation.
@ovr ovr requested a review from a team as a code owner February 27, 2026 11:38
@ovr ovr marked this pull request as draft February 27, 2026 11:38
@github-actions github-actions bot added the javascript Pull requests that update Javascript code label Feb 27, 2026
@codecov
Copy link

codecov bot commented Feb 27, 2026

Codecov Report

❌ Patch coverage is 0% with 20 lines in your changes missing coverage. Please review.
✅ Project coverage is 57.51%. Comparing base (c90b656) to head (e49cfa5).
⚠️ Report is 3 commits behind head on master.

Files with missing lines Patch % Lines
...-query-orchestrator/src/orchestrator/QueryCache.ts 0.00% 11 Missing ⚠️
...hestrator/src/orchestrator/PreAggregationLoader.ts 0.00% 9 Missing ⚠️

❗ There is a different number of reports uploaded between BASE (c90b656) and HEAD (e49cfa5). Click for more details.

HEAD has 1 upload less than BASE
Flag BASE (c90b656) HEAD (e49cfa5)
cubesql 1 0
Additional details and impacted files
@@             Coverage Diff             @@
##           master   #10445       +/-   ##
===========================================
- Coverage   83.37%   57.51%   -25.86%     
===========================================
  Files         250      222       -28     
  Lines       74886    17399    -57487     
  Branches        0     3567     +3567     
===========================================
- Hits        62434    10007    -52427     
+ Misses      12452     6856     -5596     
- Partials        0      536      +536     
Flag Coverage Δ
cube-backend 57.51% <0.00%> (?)
cubesql ?

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

javascript Pull requests that update Javascript code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant