Skip to content

Check access rights in the TimeSeries table functions - #116629

Merged
nikitamikhaylov merged 19 commits into
ClickHouse:masterfrom
groeneai:groeneai/timeseries-table-function-access-check
Sep 10, 2026
Merged

nikitamikhaylov merged 19 commits into
ClickHouse:masterfrom
groeneai:groeneai/timeseries-table-function-access-check

Conversation

@groeneai

@groeneai groeneai commented Aug 27, 2026 •

Copy link
Copy Markdown
Collaborator

Changelog category (leave one):

  • Bug Fix (user-visible misbehavior in an official stable release)

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

The table functions reading a TimeSeries table (timeSeriesSamples, timeSeriesTags, timeSeriesMetrics, timeSeriesSelector, prometheusQuery, prometheusQueryRange) checked no privilege on it: a user holding only CREATE TEMPORARY TABLE could read its target tables' column definitions and rows, and write into them. Each now requires the corresponding privilege on the TimeSeries table and on the target table, following an Alias target through to the table it points at. timeSeriesSamples, timeSeriesTags and timeSeriesMetrics check the target at table level, since they return it whole and cannot restrict the columns, so a column-scoped grant on the target is not enough; the other three run ordinary target queries, which the planner still checks per column. An external target is authorized before it is looked up, so its existence is not disclosed either. A read fails with ACCESS_DENIED when the user's effective SELECT row-policy filter on the TimeSeries table is not always true, since such a policy cannot be enforced on the target's rows, and the three target functions can no longer back a CREATE TABLE ... AS (BAD_ARGUMENTS). PromQL over the Prometheus HTTP and remote-read endpoints reaches timeSeriesSelector whenever it selects series, so those requests now need these privileges for the user the endpoint authenticated.

Description

No public issue; reported privately, fix requested by @ nikitamikhaylov.

Root cause. ITableFunction's only generic seam, checkSourceAccess, checks the source of the target's engine, not either table, inert unless that engine has one; no planner or insert path checks a table-function node.

The change. Three helpers in StorageTimeSeries.{h,cpp}, called from 13 sites. A structure always costs SHOW COLUMNS: table level where the function returns the target whole, and the one column read (id) in timeSeriesSelector, whose rows its generated query authorizes per column. An external target's configured name is authorized before the catalog is consulted, its resolved identity after, so neither a hidden target nor a rename escapes. The siblings are checked at read time, before the TimeSeries table is resolved and again on the identity it resolved to, so a persistent table over them is authorized on every read with the reader's grants, disclosing nothing to one with none.

Validation. Every guard has an arm that reddens when removed, plus entitled-caller arms catching over-denial. 50/50 green; arms split across 05045 and 05137 for the stateless time limit.

Not fixed here, measured, pre-existing: an inner target's existence stays distinguishable, both it and its derived name reachable directly past the parent check; timeSeriesSelector's read path and the Prometheus HTTP metadata endpoints resolve their targets before the generated query authorizes them, which no guard anticipates; a reader granted a persistent table's stored source name still learns its new name after a rename, for either storage, hideable only by a denial naming nothing; the source grant a target's engine asks for applies here and not to direct access; describe_include_virtual_columns = 1 needs SELECT, the base class's contract; and a table an older server persisted as CREATE TABLE ... AS timeSeriesSamples(...) still loads, since refusing it fails the database load.


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

Version info

  • Merged into: 26.9.1.1126 (included in 26.9 and later)

The six table functions that read a TimeSeries table (timeSeriesSamples,
timeSeriesTags, timeSeriesMetrics, timeSeriesSelector, prometheusQuery and
prometheusQueryRange) did not authorize the TimeSeries table they were pointed
at. A user holding only CREATE TEMPORARY TABLE, which every table function
requires anyway, could read the column definitions and the rows of a
TimeSeries table's target tables and write into them.

ITableFunction has one generic authorization seam, checkSourceAccess(), and it
is a no-op when getSourceAccessObject() returns nullopt. The three target
functions report the target engine from getStorageEngineName() and MergeTree
registers no source_access_type; the three siblings report an empty engine
name. So no check ran anywhere. Nothing downstream compensates: the planner and
InterpreterInsertQuery both skip access checks for table function nodes on the
grounds that ITableFunction::execute() has already made them.

Each function now requires what the equivalent direct operation requires: the
privilege on the TimeSeries table named in the call and, where the function
hands back or reads a target table, on that target too. Reading a structure
always requires SHOW COLUMNS regardless of the direction of the enclosing
query, because a plain DESCRIBE resolves the structure with is_insert_query set.
An Alias target is checked through to the table it points at, since its own
grant does not cover the metadata it exposes.

A row policy on the TimeSeries table cannot be enforced on the rows these
functions return, because those rows belong to a target table with different
columns, so the read direction fails closed while such a policy exists.

The three target functions can no longer back a persistent table. They hand
back a pre-existing table that stores data on disk, which
StorageTableFunctionProxy cannot proxy: on the first read of the created table
it renames the live target table in memory and then violates its own assertions
that a table function has no storage policy and stores no data on disk,
aborting debug and sanitizer builds on that read and on every later server
start that touches the persisted table.
@groeneai groeneai added can be tested Allows running workflows for external contributors groeneai-origin-oranjeai PR origin: delegated from the OranjeAI sibling fleet labels Aug 27, 2026
@groeneai

Copy link
Copy Markdown
Collaborator Author
Internal second-model review: adjudication log (click to expand)

Pre-publication review by an independent model (engine: codex; 6 findings over two full passes of
the same commit, the second after I corrected two claims in the description; no fix round was
needed, so the reviewed tree is the published one).

# Sev Finding Verdict Evidence / action
1 ❌ PromQL that selects no series reaches none of the new checks on the Prometheus HTTP endpoints (PrometheusHTTPProtocolAPI.cpp:90-95) DISAGREE Correct as a fact. Converter.cpp:27-43 sends scalar and string nodes to fromLiteral, so such a request reads no row of the TimeSeries table or its targets, only that table's timestamp type. That file is untouched here and its table comes from the handler's own configuration; every selector-bearing request is now authorized. Stated in the description.
2 ❌ Metadata loading bypasses canBeUsedToCreateTable, so a table persisted by an older server still loads (DatabaseOnDisk.cpp:109-126) DISAGREE Correct, and deliberate. Refusing in the loader would turn a failure on the first read of one table into a failure to load the whole database at startup. ITableFunctionCluster.h:49 and TableFunctionEval.cpp:69 already return false and behave the same way.
3 ⚠️ The target is checked at table level, so a column-scoped grant on it is refused where a direct SELECT succeeds AGREE on the fact, DISAGREE on the remedy PlannerJoinTree.cpp:788-808 skips access checks for table-function nodes and nothing narrows the returned storage's columns, so a column-aware check without a column-aware restriction would hand back columns the caller cannot read. TableFunctionLoop.cpp:113,142 is table level for the same reason. The requirement is now spelled out in the changelog entry.
4 ❌ An Alias chain exposes the final target's column definitions past the one-hop check AGREE on the fact, DISAGREE that it belongs here Reproduced. StorageAlias.cpp:53-56 rejects an Alias target only in the constructor, and only if that target already exists, while StorageAlias.h:122-128 delegates metadata recursively, so the one-hop check is sound only under an invariant nothing maintains. InterpreterDescribeQuery.cpp:251-257 is the same one hop, so DESCRIBE of the alias head discloses the same columns; a chain-walking change confined to this helper would leave that path exposed. The fix belongs in StorageAlias. Not fixed here.
5 ❌ A persistent prometheusQuery table authorizes its source under the name recorded at creation, not its current one AGREE on the fact, DISAGREE on the severity The reproduction returns 3, the value of the scalar 1 + 2, not a row. fromSelector.cpp:41-47 emits that same recorded name for the data path, so for PromQL that selects series the table authorized and the table read are the same one, and if the recorded name no longer resolves the read fails with UNKNOWN_TABLE. The asymmetry with StorageTimeSeriesSelector.cpp:823 is real and left as is.
6 💡 Select Critical Bug Fix (crash, data loss, RBAC) DISAGREE I do not choose that category on my own initiative; it is a maintainer's call and I will change it on request.

Two claims of my own in the description were wrong and are corrected: the Prometheus endpoints reach
the new checks through the timeSeriesSelector table function in generated SQL, not by sharing the
two configuration builders, and only when the PromQL selects series; and the neighbouring
TimeSeries, PromQL, loop()-access and Alias tests are 71/80, the 9 failures being the
NO_ZOOKEEPER and CLUSTER_DOESNT_EXIST ones a bare server also produces on the base build.

Severity: ❌ blocker / ⚠️ major / 💡 nit. DISAGREE verdicts carry recorded evidence and are
terminal per finding.

Session id: cron:clickhouse-review-slot-10:20260827-015500

@clickhouse-gh clickhouse-gh Bot closed this Aug 27, 2026
@clickhouse-gh clickhouse-gh Bot reopened this Aug 27, 2026
@groeneai

Copy link
Copy Markdown
Collaborator Author
Pre-PR validation gate (click to expand)
# Question Answer
a Deterministic repro? Yes, 100%, no randomization. Fixture is three external target tables plus CREATE TABLE ts ENGINE = TimeSeries DATA ... TAGS ... METRICS ... and a user holding only GRANT CREATE TEMPORARY TABLE ON *.* . As that user, DESCRIBE timeSeriesSamples(db.ts) returns the target's columns and SELECT * FROM timeSeriesSamples(db.ts) returns its rows, while DESCRIBE db.ts is refused with ACCESS_DENIED.
b Root cause explained? Yes. ITableFunction's only generic authorization seam is checkSourceAccess(), which is a no-op when getSourceAccessObject() returns nullopt. The three target functions return the target engine from getStorageEngineName() and MergeTree registers no source_access_type; the three siblings return an empty engine name. So no check ran anywhere, and neither the planner nor InterpreterInsertQuery compensates: both deliberately skip access checks for table-function nodes, and that planner branch is also what attaches row-level filters.
c Fix matches root cause? Yes. The checks are added at the functions' own access surface, which is what the base class delegates to: the two overrides and the two sibling config builders, plus the two sibling readImpls for the read-time direction. Nothing is guarded at a failure site, no bound is widened, no test tag added.
d Test intent preserved / new tests added? New test 05045_timeseries_table_function_access_check.sh, 35 arms, no existing test weakened or removed. Neighbourhood 71/80 green; the 9 failures are NO_ZOOKEEPER / CLUSTER_DOESNT_EXIST bare-server limitations with zero ACCESS_DENIED, and 8 of them were re-run against the pre-fix binary and fail identically.
e Both directions demonstrated? Yes. Without the fix every negative arm is permitted and only the harness control stays denied; with the fix every negative arm is denied and every positive arm still works. Additionally one mutant per guard, each reddening only its own arms, including one that keeps the sibling check but moves it out of read time so only the persistent-table arm catches it.
f Fix is general across code paths? Yes. All six registered functions plus the timeSeriesData alias, not the three in the report: both entry points of each, the structure path and the data path, the write path, the Alias wrapper, and the CREATE TABLE ... AS route. A coverage matrix maps every function to the site that guards it.
g Fix generalizes across inputs (params/datatypes/wrappers)? Yes. Covered by arms: direction (SELECT / INSERT / SHOW COLUMNS), grant shape (target only, TimeSeries table only, both, and the column-level grant that implies SHOW COLUMNS), wrapper engine (Alias checked through to its underlying table), row policy present and absent, and transient versus persistent use of the same function.
h Backward compatible? (maintainer-approved exception only) No setting added or defaulted differently and no serialization or on-disk format change, so no SettingsChangesHistory.cpp entry. Three deliberate tightenings, all stated in the PR body. Any column-level grant already implies SHOW COLUMNS, so DESCRIBE keeps working for anyone who could already read, and the database-wide grant that makes a TimeSeries table usable satisfies both new requirements.
i Invariants and contracts preserved? Yes. Each check is a read of the caller's ContextAccess performed before any state change, on every path including early returns; no lock is taken or held; getTargetTable(context) is called once per entry point and the result reused; the row-policy guard throws before any pipeline is built. Structure resolution is authorized as a read regardless of the enclosing query's direction, so DESCRIBE does not begin to require INSERT.

Session id: cron:clickhouse-impl-slot-41:20260826-235100

@clickhouse-gh

clickhouse-gh Bot commented Aug 27, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [84498ac]

Summary: ✅


AI Review

Summary

This PR closes most of the obvious RBAC gaps around the TimeSeries table functions by checking the parent TimeSeries table, checking targets before external-name lookup, and re-checking persisted timeSeriesSelector() / prometheusQuery() tables at read time. I am not ready to approve it yet: two previously-raised blocker paths are still open, and one new major issue remains in the target-function access contract for source-backed external targets.

PR Metadata
  • The selected Changelog category is not semantically correct. This patch fixes an RBAC bypass and also blocks creation of new CREATE TABLE ... AS timeSeriesSamples/Tags/Metrics(...) tables that can destroy the live target on later reads / drops, so it should use Critical Bug Fix (crash, data loss, RBAC).
  • The Changelog entry is required for that category and is already specific enough; only the category line needs changing.
  • Exact replacement: - Critical Bug Fix (crash, data loss, RBAC)
Missing context / blind spots
  • ⚠️ The full Bugfix validation matrix did not run on head 84498ac9ca8877702061748dd7643b4e22055115 because the merge commit hit the master-side arm_tidy duplicate-include failure in src/Storages/MergeTree/MergeTreeIndexConditionText.cpp. A rerun after that master fix lands is still missing evidence for the new stateless tests under the intended validation jobs.
Findings

❌ Blockers

  • [src/Storages/StorageTimeSeries.cpp:836] checkAccessToTimeSeriesTargetTable() still stops after one Alias hop, but getInMemoryMetadataPtr() on StorageAlias keeps delegating recursively. A TimeSeries target chain like alias_1 -> alias_2 -> hidden can therefore still expose the final hidden table's schema through timeSeriesSamples() / timeSeriesTags() / timeSeriesMetrics() once the caller holds grants on the visible aliases. Suggested fix: move the checked recursive resolution into StorageAlias itself and have this helper use that shared path instead of isTargetTableGranted() once.
  • [src/TableFunctions/TableFunctionTimeSeries.h:39] Refusing fresh CREATE TABLE ... AS timeSeriesSamples/Tags/Metrics(...) is only a partial mitigation. DatabaseOnDisk::createTableFromAST() never consults canBeUsedToCreateTable(), so metadata created by an older server still loads, and StorageTableFunctionProxy can still materialize, rename, drop, or truncate the live target under startup privileges. That leaves both the RBAC bypass and the data-loss path alive across upgrade. Suggested fix: fail closed when loading or first materializing persisted tables built from these functions, before startup() / renameInMemory() on the nested storage.

⚠️ Majors

  • [src/TableFunctions/TableFunctionTimeSeries.cpp:78] target_table_type_name still drives ITableFunction::checkSourceAccess(). For target engines with source_access_type (concretely File, and the same pattern applies to other source-backed external targets), DESCRIBE / SELECT / INSERT through timeSeriesSamples() / timeSeriesTags() / timeSeriesMetrics() still demand READ / WRITE ON <SOURCE> even after the new parent-table and target-table checks pass. Direct access to the target table does not go through that grant path, so the current code still over-denies the contract this PR documents. Suggested fix: stop inheriting getSourceAccessObject() from the resolved target engine here and rely on the explicit table checks plus the target storage's own runtime guards.
Tests
  • ⚠️ Add one positive case for a target engine with source_access_type (the existing File target fixture is enough): grant only the parent TimeSeries table and the target table, then prove that DESCRIBE, SELECT, and INSERT INTO FUNCTION do not still fail with READ / WRITE ON FILE. The current suite only proves the early denial message changes when the target grant is missing.
Final Verdict

Changes requested. The new guards are directionally correct, but the alias-chain metadata leak and the persisted old-metadata path are still blockers, and the target-function path still over-denies supported external targets whose engines advertise a source-level access type.

LLVM Coverage Report

Measured on commit 84498ac.

Metric Baseline Current Δ
Lines 88.80% 88.80% +0.00%
Functions 91.80% 91.80% +0.00%
Branches 81.20% 81.20% +0.00%

Changed lines: Changed C/C++ lines covered: 80/80 (100.00%) · Uncovered code

Full report · Diff report

@clickhouse-gh clickhouse-gh Bot added the pr-bugfix Pull request with bugfix, not backported by default label Aug 27, 2026
@groeneai

Copy link
Copy Markdown
Collaborator Author

cc @nikitamikhaylov @pufit, could you review this? The six table functions that read a TimeSeries table authorized nothing on it, because ITableFunction's only generic seam is checkSourceAccess() and it is a no-op for all six, so each now checks the privilege on the TimeSeries table and on the resolved target, and a read fails closed while a row policy exists on the TimeSeries table, since that policy cannot be evaluated against the target's columns.

@nikitamikhaylov, you asked to be assigned: I cannot set assignees or reviewers on this PR myself, both fail for a fork contributor, so please assign yourself. I also left the category as Bug Fix rather than picking Critical Bug Fix (crash, data loss, RBAC) on my own initiative; say the word and I will change it.

Comment thread src/Storages/StorageTimeSeries.cpp Resolved
{
context->checkAccess(access_type, target_table->getStorageID());

if (const auto * alias = target_table->as<StorageAlias>();

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.

checkAccessToTimeSeriesTargetTable stops after one Alias hop, but the structure path keeps recursing. With ts -> alias_1 -> alias_2 -> hidden, this helper checks alias_1 and alias_2, then alias_1->getInMemoryMetadataPtr() walks through to hidden without another privilege check, so DESCRIBE timeSeriesSamples(...) / timeSeriesTags(...) / timeSeriesMetrics(...) can still expose the hidden target's schema. This needs a recursive alias resolution check here, or a shared checked-resolution path in StorageAlias.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Already adjudicated on this PR: row 4 of the adjudication log (#116629 (comment)). I reproduced the chain there and agreed the one-hop check holds only under an invariant nothing maintains.

It is not fixed here because this helper is the same one hop as InterpreterDescribeQuery.cpp:251-257, so DESCRIBE of the alias head discloses the same columns; walking the chain in this one caller would leave that path exposed while reading as fixed. The fix belongs in StorageAlias, and #116153 is where I am pursuing it.

@clickhouse-gh

clickhouse-gh Bot commented Aug 27, 2026 •

Copy link
Copy Markdown
Contributor

Build profile diff (arm_release)

Comparing 84498ac9c with master 55c256363 (stripped binary size, per-symbol sizes and ThinLTO time; compile times per translation unit against the most recent warmup build that recompiled it).

✅ No significant changes.

Binary sizes

programs/clickhouse-stripped: smaller than the master baseline by the known offset between the two builds, so the difference is not shown. A delta that differs from the offset by more than 50% of it is shown, in either direction.

The official master build is compiled with -g and a pull request build is not, and XRay counts debug instructions towards its instrumentation threshold, so master instruments thousands of functions more and its binary is ~0.4% larger no matter what the pull request does.

Compile time of recompiled translation units

19 translation units recompiled, 90 s compile time in total, 19 of them have a recent master baseline.

Job report

@groeneai

Copy link
Copy Markdown
Collaborator Author

CI finish ledger - 6f1a686

Every failure below has an owner: a fixing PR (ours or external), or a full-effort fix task whose fixing-PR link will be posted here when it opens. Only CH Inc sync is exempt.

Check / test Reason Owner / fixing PR
Stress test (amd_msan) / Logical error: 'The metadata stream of AlignStreams ended before all data stream rows were matched', STID 0250-329b trunk regression in the streaming read-round alignment code introduced by merged #116128; server abort #116531 (external, open)
Stress test (arm_release) / Logical error: 'A data stream row of AlignStreams has no matching metadata stream row', STID 0250-1eed same defect, opposite direction of the same mismatch #116531 (external, open)
CH Inc sync never reported on this head CH Inc sync (private, not actionable by me)

Both stacks terminate in src/Storages/MergeTree/Streaming/ReadingPlan/AlignStreams.cpp. The family has 6 unrelated carrier PRs plus one true-master row (Stress test (arm_release), 2026-08-26 10:46:49Z), all inside ~24 h of #116128 merging, so it is not caused by this PR: the diff here is an 8-file RBAC access check in the TimeSeries table functions and touches nothing on the read-round path. #116531 "Forbid Read Limits for Streaming Queries" changes buildReadRoundPipeline.cpp, MergeTreeCommitOrderSource.cpp and ReadFromMergeTree.cpp, i.e. the read-limit overflow-break path that truncates one of the two aligned streams, so the link is causal and not merely same-area.

One caveat for anyone reading the CI report page: this head got two concurrent PR workflow runs, 33035538290 and 33035546050. Both stress jobs above failed in the second and passed in the first at the identical tree, and the later-finishing run overwrote the shared result_pr.json, which now shows both as Failures: 0/4. The same-tree pass is itself evidence the abort is state and timing dependent rather than tree dependent.

Everything else is green, including all five flaky check jobs (50/50 each) and every Integration tests and Unit tests shard.

Session id: cron:our-pr-ci-monitor:20260827-083000

@groeneai

Copy link
Copy Markdown
Collaborator Author

The canBeUsedToCreateTable() refusal in this PR also prevents data loss

I measured the shape this PR refuses, on the official release build 26.8.1.2020 (build id
f55b025afebba8148c44e957a691ab0592b044f1). Without the refusal,
CREATE TABLE al AS timeSeriesSamples(ts) persists a StorageTableFunctionProxy over the
catalog's own target table, and StorageProxy::drop() is getNested()->drop(), so dropping the
alias runs dropAllData() on the user's real table:

SET allow_experimental_time_series_table = 1;
CREATE TABLE tgt (id Tuple(UInt64, UUID), timestamp DateTime64(3), value Float64)
    ENGINE = MergeTree ORDER BY (id, timestamp);
CREATE TABLE ts ENGINE = TimeSeries SAMPLES tgt;
INSERT INTO tgt SELECT (number, toUUID('00000000-0000-0000-0000-000000000000')), now(), number
    FROM numbers(5);
CREATE TABLE al AS timeSeriesSamples(ts);
SELECT count() FROM al;
DROP TABLE al;

Afterwards tgt is still listed in system.tables, SELECT count() returns 0, it has no active
parts, its part directory is gone from disk, INSERT gives Code: 60, and DETACH and ATTACH
give Code: 49. The control arm that never reads the alias keeps all 5 rows, keeps the directory
and stays writable. TRUNCATE TABLE al destroys the data the same way, and
DROP DATABASE ... SYNC returns Code: 219 with the data already gone. With no destructive
statement at all, the target refuses INSERT and OPTIMIZE with Code: 741, because
renameInMemory has given it the alias's name and uuid. All four registered names
(timeSeriesSamples, timeSeriesData, timeSeriesTags, timeSeriesMetrics) behave identically.

So the refusal is a data loss fix and not only a tightening of the access check, and I think the
changelog entry should say that.

Two gaps it does not close:

  • DatabaseOnDisk::createTableFromAST does not consult canBeUsedToCreateTable(), so a table
    created before this change still loads and still destroys its target on DROP. An ownership
    check that fails closed before startup() and renameInMemory() in
    StorageTableFunctionProxy::getNestedImpl would cover it, and the two chasserts already there
    state exactly that predicate.
  • When the target has no parts, reading such an alias throws
    Code: 49 QueryPlan was not initialized from StorageTableFunctionProxy::read, which calls
    query_plan.getCurrentHeader() without checking isInitialized() first.

One thing worth weighing before the refusal is treated as permanent: StorageAlias already
forwards reads and writes to a catalog table while keeping drop and rename local to the alias,
so it is a candidate if this spelling should keep working instead.

@nikitamikhaylov

Copy link
Copy Markdown
Member

@groeneai make the PR green.

@nikitamikhaylov nikitamikhaylov added the comp-promql PromQL / time-series subsystem: TimeSeries storage engine, PromQL parser, PromQL-to-SQL converter... label Aug 31, 2026
@groeneai

Copy link
Copy Markdown
Collaborator Author

Both reds were the AlignStreams logical error from #116128, not from this PR: the same two signatures fired on master and across unrelated PRs starting 2026-08-26, with zero hits in the preceding 120 days.

#116128 was reverted in #116909, merged 2026-08-28 15:47 UTC, and CIDB confirms the signature is gone: 0 matching failures since then, against 47,176 Stress test rows in the same window. #116531, which my earlier ledger had linked as the fixing PR, was closed unmerged minutes after that revert, so the revert is the owner now.

Since the fix is a revert on master and not something I can pick up any other way, I merged master at 89d70c0 into the branch. Fresh CI is running on 318b3e3, and the merge changes nothing in the diff: it is still the same 8 files, +237/-3.

@groeneai

groeneai commented Sep 1, 2026

Copy link
Copy Markdown
Collaborator Author

CI finish ledger - 318b3e3868dde4cf7b65183df42693fd40c8c6b3

Every failure below has an owner: a fixing PR, or a full-effort fix task whose fixing-PR link I will post here when it opens.

Check / test Reason Owner / fixing PR
Bugfix validation (functional tests, amd64) infra: the job asserts Could not find master builds in S3 (ci/jobs/functional_tests.py:734) and ERRORs before running anything a fix task is in progress (fixing PR link to follow here)
Bugfix validation (functional tests, aarch64) same infra assert a fix task is in progress (fixing PR link to follow here)
Finish Workflow / Post Hooks cascade of the two rows above: new_tests_check.py needs at least one Bugfix validation job to report OK or XFAIL, and both ERRORed a fix task is in progress (fixing PR link to follow here)
Stateless tests (amd_llvm_coverage, old analyzer, s3 storage, DBReplicated, parallel, 1/3) / 03707_autopr_unsupported_cases trunk: the autopr positive canaries report 0 0 in the old-analyzer lane (84 unrelated PRs, 109 runs, 12 true-master hits in 14d) #117364 (external, merged 2026-08-31 22:05Z), not yet on this branch
Integration tests (amd_asan_ubsan, db disk, old analyzer, 6/6) / Container memory budget exceeded (/docker) host memory over-commit: the /docker cgroup leaf OOM-kills the nested containers and the whole shard loses its signal (244 PRs, 305 runs, 25 true-master hits in 7d) a fix task owns it at P1 (fixing PR link to follow here)

None of these is caused by this PR. #117202 (merged 2026-08-31 11:05Z) is already on this branch and the container-memory signature still fires, so it does not cover it. I am not merging master for #117364 yet: the Bugfix validation infra fix is in review right now, so a single later merge picks up both instead of burning two CI cycles.

Session id: cron:our-pr-ci-monitor:20260901-003000

@groeneai

groeneai commented Sep 1, 2026

Copy link
Copy Markdown
Collaborator Author

Fixing PR for the Bugfix validation / Finish Workflow red on this pull request (Could not find master builds in S3): #117433. The reference master binaries moved to REFs/master/<sha>/masterci/build_<type>/clickhouse when the artifact prefix gained a workflow-name segment, and find_master_builds still spelled the old path.

@nikitamikhaylov

Copy link
Copy Markdown
Member

@groeneai merge master and try again.

@nikitamikhaylov

Copy link
Copy Markdown
Member

@groeneai merge master and try one more time.

The metadata guards this branch adds to StorageTimeSeriesSelector::getConfiguration()
check the tags target at table level, while the only thing read from that target there is
the type of its id column, and the rows the function returns come from a query it
generates which the planner authorizes per column. A reader holding SELECT on the exact
tags columns that query needs was therefore refused at parse time, although the read path
serves it. The changelog entry already describes the intended split; this makes the code
match it.

Measured on the fixture of 05045, with a caller holding SELECT, SHOW COLUMNS on the parent
and on its samples target, plus GRANT SELECT(id, metric_name, tags, min_time, max_time) on
the tags target, that is every column of it individually:

  pristine master e568d26: DESCRIBE ok, SELECT count() -> 0
  this branch b161a70:     both refused, SHOW COLUMNS ON <db>.ts_tags
  with this commit:         DESCRIBE ok, SELECT count() -> 0

Revoking one column that generated query reads (min_time) refuses the read again while
DESCRIBE keeps working, so authorizing the target stays with that query instead of moving
into the guard. A caller granted the target table-wide is unaffected in all three arms.

The parent's own guard stays at table level: describing the parent directly needs
table-level SHOW COLUMNS, and the read path needs table-level SELECT on it, so that guard
refuses nobody this function serves. timeSeriesSamples(), timeSeriesTags() and
timeSeriesMetrics() keep their table-level check on the target as well, since they hand
back the target itself and cannot restrict its columns.

05045 gains four arms. The first holds the column-scoped caller above. The second covers an
inner target, whose resolved identity is all the target check has to work with there, since
an inner target has no configured name to authorize before the lookup: with the parent
granted and the inner tables not, the three functions over it are refused, and granting the
inner tags target its id column describes the selector again. Every other fixture in that
file configures external targets, so removing the resolved-target grant check left the suite
green before this arm existed. The third gives a tags target an `Alias`, which authorizes the
table it points at on that same column: granted the id column on the alias alone the selector
is refused, and granting it on the hidden table too describes it. The fourth reads under an
always-true row policy, which the read direction is documented to allow: the file covered only
a false policy and its absence, so rejecting whenever a policy exists was green there too.
@groeneai

groeneai commented Sep 8, 2026

Copy link
Copy Markdown
Collaborator Author

CI finish ledger - d8d650d

Every failure below has an owner: a fixing PR (mine or external), or a full-effort fix task
whose fixing-PR link will be posted here when it opens. Only CH Inc sync is exempt.

Check / test Reason Owner / fixing PR
Build (arm_tidy) / Build ClickHouse master-side clang-tidy error, reached because praktika builds the merge commit: src/Storages/MergeTree/MergeTreeIndexConditionText.cpp:36:1: error: duplicate include [readability-duplicate-include,-warnings-as-errors], and WERROR:BOOL=ON turns it into ninja: build stopped, exit 1. DataTypes/DataTypeLowCardinality.h is included at both line 11 and line 36 of that file on current master; the second copy arrived with #117314 (merged 2026-09-07T20:27:29Z). Master's own Build (arm_tidy) is red on every SHA since then, and this branch touches no MergeTree file at all #118661 (external, open) and #118680 (external, open), both of which delete the duplicate line
Finish Workflow / Post Hooks cascade of the row above, not an independent failure: build_arm_tidy reported failure, so praktika marked its dependees skipped, including all five Bugfix validation arms. new_tests_check.py then reds the post hook because this pr-bugfix PR adds a stateless test and no Bugfix validation arm was left to report OK or XFAIL same owner as above: #118661 and #118680
Sync - CH Inc sync (private, not actionable by me)

Mergeable Check and PR are aggregators of the two rows above, so they do not get their own lines.

What did run is green. Fast test passed with 14683 recorded test rows, and Style check,
Config Workflow and Code Review all report success; CIDB carries no other FAIL or ERROR
row at this head. The heavy matrix was dropped by the tidy failure rather than by anything in this
branch, so this head is short of test coverage and will need a re-run once either fixing PR lands.

Session id: cron:our-pr-ci-monitor:20260908-003105

… resolving it

StorageTimeSeriesSelector::readImpl() authorizes the TimeSeries table on every read, so that
a persistent table created with `CREATE TABLE dst AS timeSeriesSelector(db.ts, ...)` is
authorized with the reader's own grants rather than with those of whoever created it. It
looked that table up before the check, so a reader holding SELECT on `dst` and nothing on
`db.ts` was handed the state of `db.ts` instead of the denial: UNKNOWN_TABLE carrying its
UUID once it was dropped, TABLE_UUID_MISMATCH naming its current name once it was renamed.
Check the configured id first, as StoragePrometheusQuery::readImpl() and
StorageTimeSeriesSelector::getConfiguration() already do.

The check refuses no read that worked before it. DatabaseCatalog::getTable() returns a table
whose database and name match the id it was asked for, or throws, so on every successful read
the resolved identity carries the same name as the configured one; the resolved check kept
after the lookup covers it as before.

Measured on the fixture of 05045 with a caller holding SELECT on the persistent table alone:

  before, source dropped:  60  UNKNOWN_TABLE, naming the source and its UUID
  before, source renamed:  741 TABLE_UUID_MISMATCH, naming the source's new name
  after, both:             497 ACCESS_DENIED, as while the source exists
  after, caller granted the source: 60 again, unchanged

so the change narrows what an unauthorized reader is told without hiding breakage from
whoever may see it.

05045 gains the persistent-table lifecycle those arms describe, for both storages: a
persistent timeSeriesSelector() and a persistent prometheusQuery() over one TimeSeries table
that is then dropped, and a second selector whose TimeSeries table is renamed instead, all
read by a caller granted on the persistent tables alone. Removing this commit's check turns
the selector's dropped-source arm into UNKNOWN_TABLE and its renamed-source arm into
TABLE_UUID_MISMATCH; moving StoragePrometheusQuery::readImpl()'s own check below its lookup
turns the prometheusQuery arm into UNKNOWN_TABLE, which nothing covered before. Granting the
caller the dropped table then asks for UNKNOWN_TABLE, which fails if such a check ever starts
refusing a caller entitled to the table.

The renamed-source read is its own statement rather than part of the batch above it, because
a client stops at the first statement whose expected error does not match, which would report
a regression there as the earlier arm's failure.

Two arms are added next to the wrong-engine case for timeSeriesSamples(): the same case for
timeSeriesSelector() and prometheusQuery(), whose configured-id checks are separate code and
were unpinned, so moving either below its lookup left the file green.

One more arm holds the other half of the contract the changelog states, which was unpinned in
the same way: the functions that hand a target table back whole check it whole, so a caller
holding every column of the samples target individually reads those columns directly and is
still refused timeSeriesSamples(). Narrowing that check to a column, as timeSeriesSelector()
legitimately does for the one column it reads, hands such a caller the whole target.

Co-Authored-By: Claude Opus 5 <[email protected]>
Comment thread src/Storages/StorageTimeSeries.cpp Resolved
Comment thread src/Storages/StoragePrometheusQuery.cpp Resolved
groeneai and others added 3 commits September 8, 2026 05:02
…) read path

StorageTimeSeriesSelector::readImpl authorizes both the id a persistent table stores and the
identity that id resolves to; StoragePrometheusQuery::readImpl authorized only the stored one.
The two disagree once the source table is renamed, because DatabaseCatalog::getTableImpl compares
the resolved name to the requested one only when allow_experimental_analyzer is on: with it off,
a stale stored id resolves to the renamed table and the read went through.

Measured after RENAME TABLE ts TO ts_new against a persistent CREATE TABLE pq AS
prometheusQuery(ts, ...), with a reader holding SELECT on pq and on the source under the name pq
stores, and nothing on its current name: rows before, ACCESS_DENIED after. A reader granted the
current name as well still reads it, and the default analyzer path is unchanged, where the rename
gives TABLE_UUID_MISMATCH to every caller including one holding every grant. 05045 does not pin
this leg because reaching it needs the old analyzer.

Co-Authored-By: Claude Opus 5 <[email protected]>
timeSeriesSamples() hands its target back whole, so a column-scoped grant on that target is not
enough for it. Behind an `Alias` target the alias leg carries that rule, and only the direct-target
shape had an arm.

The caller here holds the alias whole and the table behind it column by column, reads that column
through the alias, and is still refused the target. The arm does not attribute the refusal to one
check: narrowing the alias leg to a column leaves StorageAlias refusing the same query for its own
reasons, so what it pins is the contract rather than a single site.

Co-Authored-By: Claude Opus 5 <[email protected]>
…limit

This file's runtime is client startup. At 32 client invocations it measured 78.9 to 114.4 seconds
under amd_asan_ubsan; the arms added since took it to 63 invocations and 202.3 to 204.1 seconds,
past the 180 second limit, which reds the flaky check on every head that runs it.

The persistent-table lifecycle and the target-grant arms move to 05137 with a fixture of their own,
leaving 34 client invocations here and 31 there. No arm changes: the two files' output, concatenated,
is identical to this file's previous reference, and every grant an arm in 05137 needs it now makes
itself instead of inheriting one from an earlier arm, so what each one proves is visible where it is
written.

Co-Authored-By: Claude Opus 5 <[email protected]>
@clickhouse-gh

clickhouse-gh Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

PromQL Compliance Report

Baseline: S3 master 55c256363

Metric Baseline Current Δ
Score 81.82% 81.82% +0.00%
Passed 441 441 +0
Failed 3 3 +0
Unsupported 95 95 +0

Note: score is unchanged vs baseline.

Uploaded compliance JSON for this PR commit

@nikitamikhaylov
nikitamikhaylov added this pull request to the merge queue Sep 10, 2026
Merged via the queue into ClickHouse:master with commit c0c69a7 Sep 10, 2026
175 checks passed
@robot-ch-test-poll3 robot-ch-test-poll3 added the pr-synced-to-cloud The PR is synced to the cloud repo label Sep 10, 2026
@Algunenano

Copy link
Copy Markdown
Member

@groeneai

Copy link
Copy Markdown
Collaborator Author

Reverting was right, and the cause is mine.

Root cause, measured: 05137_timeseries_table_function_target_grants creates persistent tables over timeSeriesSelector() and prometheusQuery(), then makes their stored definitions dangling on purpose (DROP TABLE ts_src_gone, RENAME TABLE ts_src_ren TO ts_src_ren_new) to assert what a reader is told afterwards. It never drops those tables, so from that point until the end of the test the database holds a table whose ATTACH cannot be replayed: TableFunctionTimeSeriesSelector::parseArguments goes through StorageTimeSeriesSelector::getConfiguration, which looks the TimeSeries table up in the catalog while the arguments are parsed. On the next start that lookup throws and metadata loading aborts for the whole server:

Load job 'load table test_a9d3l5l7v0c3.sel_src_ren' failed: Code: 60.
Table test_a9d3l5l7v0c3.ts_src_ren does not exist
...
server process is not running after 11 start attempts

Only stress restarts the server while tests are in flight, which is why only stress sees it. Since the merge it hit 2 of 2 asan legs with an identical signature (ba9fc172 amd_asan_ubsan 14:10Z, 290309210 arm_asan_ubsan 14:46Z), and 0 times on this PR's own runs.

Two things go into the reintroduction. The test must not leave a dangling definition behind. Separately, a persistent table over these functions should not be able to make the server unstartable at all: the eager catalog lookup at parse time predates this PR, so that part looks reachable on plain master (CREATE TABLE s AS timeSeriesSelector(t, 'up', 0, 9999999999), then drop t, then restart). I will confirm that against the reverted master, fix it at the source rather than only in the test, and come back here with the new PR.

@groeneai

Copy link
Copy Markdown
Collaborator Author

Confirmed against the reverted master, as promised: the startup hazard is pre-existing master code, not something this PR introduced.

timeSeriesSelector() and prometheusQuery() resolve their source table in the catalog inside parseArguments (StorageTimeSeriesSelector.cpp:133-135, StoragePrometheusQuery.cpp:106-108), because the output column types and the timestamp scale are read from that table. Both lines survive the revert untouched. Startup replays parseArguments at DatabaseOnDisk::createTableFromAST:119, before execute(), so it throws UNKNOWN_TABLE, and loadMetadata.cpp:335 waits on that load job without no_throw, so one failed table aborts metadata loading for the whole server.

That is a defect rather than a fact of life: ITableFunction.h:33-39 says the structure is written to the metadata file "to avoid failures on server startup", and the failing ATTACH does carry (id UInt64, timestamp DateTime64(3), value Float64), so ITableFunction::execute would have built a lazy StorageTableFunctionProxy and resolved nothing at load time. The eager lookup one call earlier is what prevents that.

My test is still what triggered it, and dropping the three leftover proxies only shortens the window, since a kill can land inside it. So the fix I would send is both halves: drop the leftovers, and move the catalog lookup out of parseArguments into the lazy path, with the access checks staying exactly where they were adjudicated, on the configured name and before the lookup.

Two sequencing notes, both yours to decide:

There is a cheaper lever if you prefer it: canBeUsedToCreateTable() { return false; } on those two functions, one line each, which is what this PR already does for timeSeriesSamples, timeSeriesTags and timeSeriesMetrics. It refuses CREATE TABLE ... AS outright instead of making the replay safe, so it drops a working capability and makes the two persisted-read-path commits here dead code. That is why I did not pick it, but it is a one-line change if you would rather have it.

@groeneai

Copy link
Copy Markdown
Collaborator Author

Reporting back as promised, now that #119282 is closed.

The access-rights half is not mine to re-land: #119282 (comment) says "Checking access rights for TimeSeries needs to be fixed manually, I'll do that". So I am not opening a competing re-land, and I am leaving that half alone.

One thing worth knowing for whoever writes that fix, because it is what got this PR reverted rather than anything about the checks themselves: the test added here left three persisted tables defined over timeSeriesSelector() / prometheusQuery() behind while dropping and renaming their source TimeSeries table. A restart inside that window replays those definitions at startup, parseArguments resolves the source in the catalog, and one failed load job aborts metadata loading for the whole server. A test in this area must not leave a dangling stored definition behind.

The startup defect itself is pre-existing master code, not something this PR introduced: StorageTimeSeriesSelector.cpp:133-135 and StoragePrometheusQuery.cpp:106-108 still resolve eagerly on master after the revert, and 26.3, 26.6, 26.7 and 26.8 carry the same lines. It is independent of access rights, so I am fixing it in a separate PR and will post the link here.

@groeneai

Copy link
Copy Markdown
Collaborator Author

Here is the separate PR for the startup half, as promised: #119662

It moves the source lookup out of parseArguments() for timeSeriesSelector(), prometheusQuery() and prometheusQueryRange(), so a stored definition replays without resolving anything and reports a missing source only when it is read. No access-rights code is touched, so it does not collide with the manual fix for that half. Its own test drops every table and database it creates, which is the part that got this PR reverted.

pull Bot pushed a commit to SINHASantos/ClickHouse that referenced this pull request Sep 13, 2026
`CREATE TABLE p AS timeSeriesData(ts)` was accepted, and then `DROP TABLE ts`
dropped `p` instead of the inner samples table and destroyed its rows. On a
build with assertions the first read of `p` aborted the server on
`!nested_storage->getStoragePolicy()`, from analyzer identifier resolution.

`TableFunctionTimeSeriesTarget::executeImpl` returns the TimeSeries table's
target table, which is the catalog's own StoragePtr. Persisting a table
function wraps its result in a StorageTableFunctionProxy, and that proxy may
only hold a storage with no storage policy that stores nothing on disk: it
renames the storage in memory to its own id and only then asserts those two
properties. An inner target is a MergeTree, so it violates both, and after the
rename every StorageTimeSeries path that resolves a target through
getTargetTable(...)->getStorageID() - dropInnerTableIfAny,
checkTableSizeBelowDropLimit, truncate - resolves to the user's table.

Refuse the persistence instead, the way the MergeTree introspection functions
and viewIfPermitted already do. The override sits on the class template, so all
three instantiations, the timeSeriesData alias and any future ViewTarget::Kind
inherit it. The transient form does not go through the proxy and is unaffected.

This re-lands the veto that ClickHouse#116629 already merged and that 29d745e
reverted for an unrelated reason: that PR's own test left persisted definitions
behind over a dropped source, so a stress restart aborted metadata loading. The
new test drops every table it creates and asserts that no Proxy row survives.

Closes: ClickHouse#119648
alexey-milovidov added a commit that referenced this pull request Sep 13, 2026
Edited by hand following .claude/skills/edit-changelog/SKILL.md, consolidating
the nine raw blocks generated between 2026-09-06 and 2026-09-13. The
NightlyChangelog job rejected its own edits every night in that period: the
verifier did not know that #116566 (reverted by #116586) had itself reverted
#109710, so it demanded that no trace of #116586 remain while the rules put
its link on the CatBoost entry. Fixed in the job by
#119866; this edit passes the
patched verifier, and the trailers below give the ledger the missing chain.

Failed runs: https://github.com/ClickHouse/ClickHouse/actions/runs/34006912773
through https://github.com/ClickHouse/ClickHouse/actions/runs/34668133756

Changelog-revert: 116566 109710 Revert "Remove CatBoost integration"
Changelog-revert: 116586 116566 Revert "Revert "Remove CatBoost integration""
Changelog-revert: 117629 117295 Revert "Skip Darwin fast test in PRs unless labeled ci-macos"
Changelog-revert: 118525 118218 Revert "Do not wait for the remote drain when cancelling a remote query"
Changelog-revert: 119043 117866 Revert "Add `ci-coverage` label to force LLVM coverage jobs on tests-only PRs"
Changelog-revert: 119269 118239 Revert "Require agents to run the style check locally before pushing"
Changelog-revert: 119270 115343 Revert "Resume a NATS JetStream subscription after a reconnect"
Changelog-revert: 119274 118919 Revert "Carry the mutation version onto a rewritten lightweight `DELETE`"
Changelog-revert: 119275 114817 Revert "Convert OUTER join to INNER join by null-rejecting join conditions"
Changelog-revert: 119276 110939 Revert "Support real hard links for plain_rewritable metadata."
Changelog-revert: 119279 117449 Revert "Print file offsets in the bare fatal stack traces and build the release binary as PIE"
Changelog-revert: 119281 116629 Revert "Check access rights in the TimeSeries table functions"
Changelog-revert: 119298 118606 Revert "Proper partition pruning with dates"
Changelog-revert: 119323 117768 Revert "Docs: Skip private sync for documentation-only pull requests"
Changelog-revert: 119334 117356 Revert "Unify the spill trigger for hash joins"
Changelog-revert: 119429 114562 Revert "Fix NO_SUCH_COLUMN_IN_TABLE naming a column absent from the table when a part's columns were all renamed or all dropped"
Changelog-deleted-entry: 110939 [New Feature] [raw] * Disks with the `plain_rewritable` metadata (`s3_plain_rewritable`, and `azure`/`local` object storages with `metadata_type = plain_rewritable`) support hard links if configured with the new `enable_hard_links` setting, which enables `ALTER` operations and mutations on `MergeTree` tables stored on them. Mutations and partition operations share the unchanged blobs between parts instead of copying them. The setting is off by default, because a disk that has hard links cannot be read by older servers. [#110939](#110939) ([yanglongwei](https://github.com/ylw510)).
Changelog-deleted-entry: 114562 [Bug Fix (user-visible misbehavior in an official stable release)] [raw] * Fixed `NO_SUCH_COLUMN_IN_TABLE` naming a column that is not in the table, when reading or merging a part whose columns had all been renamed or all dropped by a mutation that was not applied yet. The merge kept being retried, so the table stopped compacting. Also fixed the columns of a `MergeTree` part produced by such a merge reading as their default values until the mutation was applied. [#114562](#114562) ([Shaohua Wang](https://github.com/tiandiwonder)).
Changelog-deleted-entry: 114817 [Performance Improvement] [raw] * Convert `OUTER JOIN` to `INNER JOIN` when a later JOIN condition filters out its NULL-extended rows, and filter NULL join keys directly at the table scan when column statistics show it is selective. Only conditions of the form `expr1` OP `expr2` are considered, where OP is one of `=`, `<`, `<=`, `>`, `>=`. Each side can be a column or an expression that propagates NULLs. Controlled by the new settings `query_plan_derive_not_null_filters_from_joins` (enabled by default), `query_plan_allow_derived_not_null_filters_execution` (enabled by default) and `query_plan_max_selectivity_for_not_null_filters_execution` (0.7 by default). [#114817](#114817) ([Hechem Selmi](https://github.com/m-selmi)).
Changelog-deleted-entry: 115343 [Bug Fix (user-visible misbehavior in an official stable release)] [raw] * Fixed a `NATS` engine table reading from a JetStream stream (`nats_stream`) silently stopping to consume messages after the NATS server restarted or the connection was re-established. [#115343](#115343) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
Changelog-deleted-entry: 116629 [Bug Fix (user-visible misbehavior in an official stable release)] [raw] * The table functions reading a `TimeSeries` table (`timeSeriesSamples`, `timeSeriesTags`, `timeSeriesMetrics`, `timeSeriesSelector`, `prometheusQuery`, `prometheusQueryRange`) checked no privilege on it: a user holding only `CREATE TEMPORARY TABLE` could read its target tables' column definitions and rows, and write into them. Each now requires the corresponding privilege on the `TimeSeries` table and on the target table, following an `Alias` target through to the table it points at. `timeSeriesSamples`, `timeSeriesTags` and `timeSeriesMetrics` check the target at table level, since they return it whole and cannot restrict the columns, so a column-scoped grant on the target is not enough; the other three run ordinary target queries, which the planner still checks per column. An external target is authorized before it is looked up, so its existence is not disclosed either. A read fails with `ACCESS_DENIED` when the user's effective `SELECT` row-policy filter on the `TimeSeries` table is not always true, since such a policy cannot be enforced on the target's rows, and the three target functions can no longer back a `CREATE TABLE ... AS` (`BAD_ARGUMENTS`). PromQL over the Prometheus HTTP and remote-read endpoints reaches `timeSeriesSelector` whenever it selects series, so those requests now need these privileges for the user the endpoint authenticated. [#116629](#116629) ([Groene AI](https://github.com/groeneai)).
Changelog-deleted-entry: 117356 [Backward Incompatible Change] [raw] * `max_bytes_before_external_join` and `max_bytes_ratio_before_external_join` are now the spill threshold for every hash-based `join_algorithm`, including `grace_hash`, which previously ignored them and spilled on `max_rows_in_join` / `max_bytes_in_join` instead. Those two are a hard cap again for every algorithm: they no longer cause spilling, and a join that spills no longer exceeds them. All join algorithms remain available; `join_algorithm = 'grace_hash'` now needs a non-zero spill threshold, and is skipped in favour of the next algorithm in the list when it has none. Set `legacy_join_size_limits_trigger_spilling = 1` (or `compatibility` to 26.8 or older) to restore the previous behavior. [#117356](#117356) ([Yarik Briukhovetskyi](https://github.com/yariks5s)).
Changelog-deleted-entry: 117449 [Build/Testing/Packaging Improvement] [raw] * ClickHouse is now built as a position independent executable on Linux amd64 and aarch64 with glibc, including the release builds, so the text segment is subject to ASLR. Addresses in the bare stack trace of a fatal log are now file offsets relative to the object that contains them, annotated with that object for frames outside the main executable, so they can be resolved with `addr2line -e <object> <hex>` regardless of where the binary was loaded. For the same reason `system.errors.last_error_trace`, `system.error_log.last_error_trace` and `system.crash_log.trace` now store a frame of the main executable as its file offset, keeping runtime addresses for frames in other objects. [#117449](#117449) ([Groene AI](https://github.com/groeneai)).
Changelog-deleted-entry: 117768 [NOT FOR CHANGELOG / INSIGNIFICANT] [raw] * Not applicable. [#117768](#117768) ([Dominic Tran](https://github.com/dhtclk)).
Changelog-deleted-entry: 118218 [Bug Fix (user-visible misbehavior in an official stable release)] [raw] * Fixed cancelling a distributed, `s3Cluster` or parallel-replicas `SELECT` taking up to `receive_timeout` (300 s by default) to take effect, and never reaching some of the remote sources, when one of them was draining the packets left over after a `LIMIT` was satisfied. [#118218](#118218) ([Groene AI](https://github.com/groeneai)).
Changelog-deleted-entry: 118239 [NOT FOR CHANGELOG / INSIGNIFICANT] [raw] * Require agents to run the style check locally before pushing. [#118239](#118239) ([Nikita Fomichev](https://github.com/fm4v)).
Changelog-deleted-entry: 118606 [Bug Fix (user-visible misbehavior in an official stable release)] [raw] * Proper partition pruning with dates. Closes [#103433](#103433). [#118606](#118606) ([Konstantin Vedernikov](https://github.com/scanhex12)).
Changelog-deleted-entry: 118919 [Bug Fix (user-visible misbehavior in an official stable release)] [raw] * Fixed a pending lightweight `DELETE` read with `apply_mutations_on_fly = 1` evaluating its predicate over patch parts created after it, which made rows disappear from the result and reappear after the mutation materialized. [#118919](#118919) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

can be tested Allows running workflows for external contributors comp-promql PromQL / time-series subsystem: TimeSeries storage engine, PromQL parser, PromQL-to-SQL converter... groeneai-origin-oranjeai PR origin: delegated from the OranjeAI sibling fleet pr-bugfix Pull request with bugfix, not backported by default 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.

5 participants