You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: cross-cluster ClickHouse support with configurable distributed table suffix
In multi-cluster ClickHouse deployments (multi-region, read/write
separation), queries need to fan out across all clusters through a
virtual cluster (e.g. "all"). This requires a second set of distributed
tables with skip_unavailable_shards=1, using a different suffix and
cluster name than the write-path tables.
Changes:
1. Configurable distributed table suffix (CLICKHOUSE_DIST_SUFFIX):
- New shared/distconfig package reads the suffix at startup
- All hardcoded "_dist" replaced with distconfig.Suffix()
- InitDistTableNames() re-registers table name mappings after init
- Default remains "_dist" for full backward compatibility
2. Cross-cluster read-path DDL (CLICKHOUSE_READ_CLUSTER):
- When set to a different cluster than CLUSTER_NAME, the DDL phase
creates additional distributed tables for cross-cluster reads
- New SQL templates: log_read_dist.sql, traces_read_dist.sql,
profiles_read_dist.sql (version keys 7, 8, 9)
- All read tables include SETTINGS skip_unavailable_shards = 1
3. Status attribute mapping:
- TraceQL: { status = ok } now queries otel.status_code
- Tempo tag values API: /api/search/tag/status/values maps correctly
4. Bug fix: leading space in health check table name " time_series_dist"
Example multi-cluster configuration:
CLUSTER_NAME=my_cluster # write cluster
CLICKHOUSE_READ_CLUSTER=all # read cluster spanning all clusters
CLICKHOUSE_DIST_SUFFIX=_all # suffix for read-path tables
Closes#780
0 commit comments