Skip to content

Commit b4cb3d7

Browse files
committed
fix(clickhouse): ensure start_time is never older than X ms to prevent old partition merge issues
1 parent 6ae1317 commit b4cb3d7

File tree

4 files changed

+180
-27
lines changed

4 files changed

+180
-27
lines changed

apps/webapp/app/env.server.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1149,8 +1149,14 @@ const EnvironmentSchema = z
11491149
EVENTS_CLICKHOUSE_WAIT_FOR_ASYNC_INSERT: z.string().default("1"),
11501150
EVENTS_CLICKHOUSE_ASYNC_INSERT_MAX_DATA_SIZE: z.coerce.number().int().default(10485760),
11511151
EVENTS_CLICKHOUSE_ASYNC_INSERT_BUSY_TIMEOUT_MS: z.coerce.number().int().default(5000),
1152+
EVENTS_CLICKHOUSE_START_TIME_MAX_AGE_MS: z.coerce
1153+
.number()
1154+
.int()
1155+
.default(60_000 * 5), // 5 minutes
11521156
EVENT_REPOSITORY_CLICKHOUSE_ROLLOUT_PERCENT: z.coerce.number().optional(),
1153-
EVENT_REPOSITORY_DEFAULT_STORE: z.enum(["postgres", "clickhouse", "clickhouse_v2"]).default("postgres"),
1157+
EVENT_REPOSITORY_DEFAULT_STORE: z
1158+
.enum(["postgres", "clickhouse", "clickhouse_v2"])
1159+
.default("postgres"),
11541160
EVENT_REPOSITORY_DEBUG_LOGS_DISABLED: BoolEnv.default(false),
11551161
EVENTS_CLICKHOUSE_MAX_TRACE_SUMMARY_VIEW_COUNT: z.coerce.number().int().default(25_000),
11561162
EVENTS_CLICKHOUSE_MAX_TRACE_DETAILED_SUMMARY_VIEW_COUNT: z.coerce.number().int().default(5_000),

0 commit comments

Comments
 (0)