Skip to content

Commit b04bb82

Browse files
authored
[CRCR] Add 100-day TTL to crcr_workflow_job (#8556)
## Summary Adds a 100-day TTL to `default.crcr_workflow_job`, addressing #8549. The table previously had no data retention, causing indefinite accumulation. ### Key decisions | Decision | Choice | Rationale | |---|---|---| | TTL column | `_inserted_at` | Server-controlled (`MATERIALIZED now()`), immutable, avoids epoch-0 `started_at` bug | | Retention | 100 days | 10-day buffer over the metrics page's "Last 90 days" view (TTL enforcement is async) | | Partitioning | None added | `ReplacingMergeTree` only deduplicates within a partition; partitioning on a mutable column risks breaking `FINAL` correctness | ### Migration ```sql ALTER TABLE default.crcr_workflow_job MODIFY TTL toDate(_inserted_at) + toIntervalDay(100); ``` No table recreation required — `ALTER TABLE ... MODIFY TTL` works on existing tables. Closes #8549
1 parent a275efc commit b04bb82

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

  • clickhouse_db_schema/default.crcr_workflow_job

clickhouse_db_schema/default.crcr_workflow_job/schema.sql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,5 @@ CREATE TABLE default.crcr_workflow_job
3838
)
3939
ENGINE = SharedReplacingMergeTree('/clickhouse/tables/{uuid}/{shard}', '{replica}')
4040
ORDER BY (downstream_repo, delivery_id, dynamoKey)
41+
TTL toDate(_inserted_at) + toIntervalDay(100)
4142
SETTINGS index_granularity = 8192

0 commit comments

Comments
 (0)