Skip to content

TimeSeries: Drop support for external targets - #126742

Merged
nikitamikhaylov merged 1 commit into
ClickHouse:masterfrom
vitlibar:timeseries-drop-external-tables-support
Oct 20, 2026
Merged

nikitamikhaylov merged 1 commit into
ClickHouse:masterfrom
vitlibar:timeseries-drop-external-tables-support

Conversation

@vitlibar

@vitlibar vitlibar commented Oct 19, 2026 •

Copy link
Copy Markdown
Member

Changelog category (leave one):

  • Experimental Feature

Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):

TimeSeries: Drop support for external targets. Setting id_type and id_generator were designed to help handling external targets, so they shouldn't be used anymore.

Introduces version 10 of the TimeSeries table engine: every target of a new table is an inner table, external targets are not allowed anymore, and settings id_type and id_generator as well. Tables of earlier versions keep their external target tables and these settings.


Workflow [PR]
Sync PR [sync-upstream/pr/126742]

Version info

  • Merged into: 26.11.1.303-master (included in 26.11 and later)

@vitlibar vitlibar changed the title Drop external targets and id settings from new TimeSeries tables TimeSeries: Drop external targets and id settings from new TimeSeries tables Oct 19, 2026
@vitlibar vitlibar added the comp-promql PromQL / time-series subsystem: TimeSeries storage engine, PromQL parser, PromQL-to-SQL converter... label Oct 19, 2026
@vitlibar
vitlibar force-pushed the timeseries-drop-external-tables-support branch from 49d62fa to 8e3838f Compare October 19, 2026 16:36
@clickhouse-gh

clickhouse-gh Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [681c2e1]

Summary: ✅


AI Review

Summary

Reviewed 681c2e161d25ca70cad5b352a8ebd5330b7c84bb. New TimeSeries tables use version 10, inner targets, and column defaults for identifier generation; earlier versions retain their features. ⚠️ Request changes: copying a valid legacy table can fail when its identifier type has no built-in generator. No new inline findings; the concerns below remain from resolved discussions.

PR Metadata

Experimental Feature is appropriate and requires a changelog entry. The entry now names both identifier settings, but still omits migration instructions: the version explanation follows a blank line and is excluded from the published entry. Suggested single-paragraph replacement:

New TimeSeries tables use version 10 and require inner target tables. Declare identifier types and generators through TAGS INNER COLUMNS instead of the id_type and id_generator settings. Existing tables retain their behavior; specify SETTINGS version = 9 when creating a table that needs the older features.

Findings

⚠️ Majors

  • src/Storages/TimeSeries/normalizeTimeSeriesDefinitionImpl.cpp:562 — [P2] Copying supported legacy identifier types can fail. [dismissed by author -- https://github.com/TimeSeries: Drop support for external targets #126742#discussion_r4317619829]

    The copy inherits String but drops its working generator. normalizeInnerColumns then calls TimeSeriesIDGenerator::getDefault, which throws INCORRECT_QUERY for String. The author's acceptance of replacing custom generators does not cover this case: no default exists for this supported identifier type.

    SET enable_time_series_table = 1;
    CREATE TABLE src ENGINE = TimeSeries
    SETTINGS version = 9, id_type = 'String',
        id_generator = 'toString(sipHash64(tags))';
    CREATE TABLE dst AS src;

    Preserve a usable expression in the copied TAGS INNER COLUMNS default when the inherited type has no built-in generator.

💡 Nits

  • [P3] Publish the migration guidance in the changelog entry. [dismissed by author -- https://github.com/TimeSeries: Drop support for external targets #126742#discussion_r4317619844] The identifier settings are now mentioned, but “shouldn't be used anymore” does not explain their rejection or the replacement syntax; the migration paragraph remains outside the extracted entry. Use the replacement above.
Tests
  • ⚠️ Add a focused regression test that copies a version-9 table with a String identifier and a custom generator into version 10, then verifies insertion into the copy. Current copy tests cover types with built-in generators and miss this failure.
Final Verdict

⚠️ Request changes. Preserve a usable generator when copying supported identifier types without a built-in default, and cover that migration. Keep changelog migration guidance in the extracted paragraph.

@clickhouse-gh clickhouse-gh Bot added the pr-experimental Experimental Feature label Oct 19, 2026
@vitlibar
vitlibar force-pushed the timeseries-drop-external-tables-support branch from 8e3838f to 1354aec Compare October 19, 2026 18:10
@vitlibar vitlibar changed the title TimeSeries: Drop external targets and id settings from new TimeSeries tables TimeSeries: Drop support for external targets Oct 19, 2026
@vitlibar
vitlibar force-pushed the timeseries-drop-external-tables-support branch from 1354aec to 5ab8e6f Compare October 19, 2026 18:33
Version 10 of the TimeSeries table engine: every target of a new table is an inner table,
and the type of the `id` column and the expression generating identifiers are declared in
`TAGS INNER COLUMNS` instead of the settings `id_type` and `id_generator`. Tables of earlier
versions keep their external target tables and these settings. The settings of the earlier
versions are grouped at the end of the settings list. Tests which used external targets or
the settings only for convenience use inner tables now, tests of the legacy features are
pinned to version 9.
@vitlibar
vitlibar force-pushed the timeseries-drop-external-tables-support branch from 5ab8e6f to 681c2e1 Compare October 19, 2026 20:12
@clickhouse-gh

clickhouse-gh Bot commented Oct 19, 2026

Copy link
Copy Markdown
Contributor

PromQL Compliance Report

Baseline: S3 master 24c090405

Suite Baseline Current Delta
Prometheus compliance 100.00% 100.00% +0.00%
Extended support (upstream engine tests) 93.17% 93.17% +0.00%
Suite Passed Failed Unsupported
Prometheus compliance 539 -> 539 (+0) 0 -> 0 (+0) 0 -> 0 (+0)
Extended support (upstream engine tests) 682 -> 682 (+0) 16 -> 16 (+0) 34 -> 34 (+0)

Extended support (upstream engine tests): native-histogram exclusions: 149; excluded assertions: 248; upstream 3da2514eff5c.

Note: Prometheus compliance score is unchanged vs baseline.

Uploaded compliance JSON for this PR commit

@vitlibar
vitlibar marked this pull request as ready for review October 19, 2026 23:59
@nikitamikhaylov
nikitamikhaylov added this pull request to the merge queue Oct 20, 2026
Merged via the queue into ClickHouse:master with commit c50ceb7 Oct 20, 2026
178 checks passed
@robot-clickhouse robot-clickhouse added the pr-synced-to-cloud The PR is synced to the cloud repo label Oct 20, 2026
groeneai added a commit to groeneai/ClickHouse that referenced this pull request Oct 22, 2026
Since ClickHouse#117253, `executeToDatabase` takes `getExclusiveDDLGuardForDatabase`
on the old database name itself, before `ViewDefinitionsRenaming::prepare`
takes it again for both names. `SharedMutex` is not recursive, so every
`RENAME DATABASE` blocked forever on the merged tree, including for an empty
database. `prepare` now takes only the new name; the old one is held by the
caller for the whole rename.

`TimeSeriesVersion.h` moved to `Parsers/Prometheus`; the check function is
declared in `Storages/TimeSeries/checkTimeSeriesVersion.h`.

Since ClickHouse#126742, a new `TimeSeries` table of version 10 cannot have external
target tables, so `05345` pins `version = 7` (the latest version when the
test was written; tables of version 9 or earlier keep their external targets
and are still rewritten).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
groeneai added a commit to groeneai/ClickHouse that referenced this pull request Oct 23, 2026
…pped

ClickHouse#126742 made TimeSeries version 10 (inner targets only) the default, so
`CREATE TABLE ts ENGINE = TimeSeries DATA ts_data ...` now fails with
INCORRECT_QUERY and the test fails before reaching the query it guards.

The test needs time series whose tags and time ranges exist while the
samples table has no parts. It used to get that by truncating an external
data table. Inner tables have generated names, so now the tags are inserted
with empty sample arrays and the time ranges are written through
`timeSeriesTimeRanges`; the samples for the "with data" part are added
through `timeSeriesSamples`. Inserting tags with empty samples alone is not
enough: without time ranges no series matches and the query never reaches
the parallel replicas local plan.

Measured on a debug build: the snapshot master binary (31d10e5, no fix)
dies on the test at timeSeriesStoreTags.cpp:117 'Context has expired'; the
PR head passes it 50/50 with random settings, 10/10 with
serialize_query_plan = 1 and 10/10 with a Replicated database. The
reference is unchanged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp-promql PromQL / time-series subsystem: TimeSeries storage engine, PromQL parser, PromQL-to-SQL converter... pr-experimental Experimental Feature pr-synced-to-cloud The PR is synced to the cloud repo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants