Skip to content

Commit 291977b

Browse files
committed
feat: Enable drop pre-aggregations without touch by default. **NOTE:** This change may adversely affect deployments which has incorrectly configured Refresh Worker instance.
1 parent 6dc48f8 commit 291977b

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

docs/content/Configuration/Environment-Variables-Reference.mdx

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,18 @@ If `true`, enables development mode.
240240
| --------------- | ---------------------- | --------------------- |
241241
| `true`, `false` | `true` | `false` |
242242

243+
## `CUBEJS_DROP_PRE_AGG_WITHOUT_TOUCH`
244+
245+
If `true`, it enables dropping pre-aggregations that Refresh Worker doesn't touch within [`CUBEJS_TOUCH_PRE_AGG_TIMEOUT`](#cubejs-touch-pre-agg-timeout).
246+
Pre-aggregations are touched whenever those rebuilt or Refresh Worker checks its freshness.
247+
The first drop will be initiated when the Refresh Worker is able to check freshness for every `scheduledRefresh: true` pre-aggregation.
248+
If you have multiple Refresh Workers with different schema versions sharing the same Cube Store cluster, then touches from both refresh workers
249+
are respected.
250+
251+
| Possible Values | Default in Development | Default in Production |
252+
| --------------- | ---------------------- | --------------------- |
253+
| `true`, `false` | `true` | `true` |
254+
243255
## `CUBEJS_GH_API_TOKEN`
244256

245257
A [GitHub Personal Access Token][gh-docs-pat] to avoid API rate limiting when
@@ -494,6 +506,15 @@ If `true`, then send telemetry to Cube.
494506
| --------------- | ---------------------- | --------------------- |
495507
| `true`, `false` | `true` | `true` |
496508

509+
## `CUBEJS_TOUCH_PRE_AGG_TIMEOUT`
510+
511+
The number of seconds without a touch before pre-aggregation is considered orphaned and marked for removal.
512+
Please see [`CUBEJS_DROP_PRE_AGG_WITHOUT_TOUCH`](#cubejs-touch-pre-agg-timeout) to learn more.
513+
514+
| Possible Values | Default in Development | Default in Production |
515+
| --------------- | ---------------------- | --------------------- |
516+
| A valid number | 86400 | 86400 |
517+
497518
## `CUBEJS_WEB_SOCKETS`
498519

499520
If `true`, then use WebSocket for data fetching.

packages/cubejs-backend-shared/src/env.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -582,7 +582,7 @@ const variables: Record<string, (...args: any) => any> = {
582582
* Expire time for touch records
583583
*/
584584
dropPreAggregationsWithoutTouch: (): boolean => get('CUBEJS_DROP_PRE_AGG_WITHOUT_TOUCH')
585-
.default('false')
585+
.default('true')
586586
.asBoolStrict(),
587587

588588
/** ****************************************************************

0 commit comments

Comments
 (0)