Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions docker/clickhouse/local/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@
<query_log>
<database>system</database>
<table>query_log</table>
<ttl>event_date + INTERVAL 3 DAY DELETE</ttl>

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.

🔵 minor — The 3-day TTL also applies to the documented Docker Compose deployment, not just dev

The root docker-compose.yml mounts this same file (line 123, data in .volumes/ch_data). DEPLOY.md ("All-in-one Docker Compose Stack") tells people to run that file with docker compose up -d and gives production advice for it. So self-hosters who pull this change silently drop to 3 days of system.query_log, trace_log, part_log and the rest. On their first restart ClickHouse also renames their existing tables to *_0. Those tables are never cleaned up, so they keep growing on disk, and their history is no longer in the table they query. That is the same user-facing concern the PR gives for leaving docker/hyperdx/clickhouseConfig.xml alone. Fix options: give the dev, CI and e2e compose files their own TTL settings (for example a config.d/ drop-in that only they mount) and leave the root docker-compose.yml unchanged. Otherwise, treat this as a user-facing change: add a changeset or release note covering the retention change and the _0 cleanup step.

Advisory. Fix if it is a small defect in code this PR changes; otherwise reply in the thread. Do not widen the PR or touch files it did not already change. How to respond

<flush_interval_milliseconds>7500</flush_interval_milliseconds>
</query_log>

Expand All @@ -98,6 +99,7 @@
<metric_log>
<database>system</database>
<table>metric_log</table>
<ttl>event_date + INTERVAL 3 DAY DELETE</ttl>
<flush_interval_milliseconds>7500</flush_interval_milliseconds>
<collect_interval_milliseconds>1000</collect_interval_milliseconds>
</metric_log>
Expand All @@ -109,6 +111,7 @@
<asynchronous_metric_log>
<database>system</database>
<table>asynchronous_metric_log</table>
<ttl>event_date + INTERVAL 3 DAY DELETE</ttl>
<!--
Asynchronous metrics are updated once a minute, so there is
no need to flush more often.
Expand All @@ -134,6 +137,7 @@
engine MergeTree
partition by toYYYYMM(finish_date)
order by (finish_date, finish_time_us, trace_id)
ttl finish_date + INTERVAL 3 DAY DELETE
</engine>
<database>system</database>
<table>opentelemetry_span_log</table>
Expand All @@ -155,6 +159,7 @@
<processors_profile_log>
<database>system</database>
<table>processors_profile_log</table>
<ttl>event_date + INTERVAL 3 DAY DELETE</ttl>

<partition_by>toYYYYMM(event_date)</partition_by>
<flush_interval_milliseconds>7500</flush_interval_milliseconds>
Expand All @@ -166,6 +171,7 @@
<part_log>
<database>system</database>
<table>part_log</table>
<ttl>event_date + INTERVAL 3 DAY DELETE</ttl>
<partition_by>toYYYYMM(event_date)</partition_by>
<flush_interval_milliseconds>7500</flush_interval_milliseconds>
</part_log>
Expand All @@ -175,6 +181,7 @@
<trace_log>
<database>system</database>
<table>trace_log</table>
<ttl>event_date + INTERVAL 3 DAY DELETE</ttl>

<partition_by>toYYYYMM(event_date)</partition_by>
<flush_interval_milliseconds>7500</flush_interval_milliseconds>
Expand All @@ -185,6 +192,7 @@
<query_thread_log>
<database>system</database>
<table>query_thread_log</table>
<ttl>event_date + INTERVAL 3 DAY DELETE</ttl>
<partition_by>toYYYYMM(event_date)</partition_by>
<flush_interval_milliseconds>7500</flush_interval_milliseconds>
</query_thread_log>
Expand All @@ -194,6 +202,7 @@
<query_views_log>
<database>system</database>
<table>query_views_log</table>
<ttl>event_date + INTERVAL 3 DAY DELETE</ttl>
<partition_by>toYYYYMM(event_date)</partition_by>
<flush_interval_milliseconds>7500</flush_interval_milliseconds>
</query_views_log>
Expand Down
Loading