Repository navigation
Do not load other tests' lazy tables in 00076_system_columns_bytes - #122532
alexey-milovidov merged 1 commit into
Conversation
05153_alias_truncate_lock failed in https://github.com/ClickHouse/ClickHouse/actions/runs/36297932393/job/108585515908 because its lazy targets were already loaded when it checked them: the server log shows the concurrent 00076 query ab529e2a loading mt_i and rmt_j through 05153's Alias tables between its ATTACH DATABASE and the check. 00076 reads the column sizes of every table on the server. Excluding the TableProxy and Alias engines in its system.tables subquery prevents the load instead of hiding the rows: the IN set filters the tables before any size is read. A TableProxy is a table of a lazy_load_tables database that nothing has read yet, and reading its sizes loads it; an Alias forwards the size read to its target, which can be such a table. With a concurrent loop issuing 00076's query, 05153 failed 14 of 30 runs with the old query, 11 of 30 when only TableProxy is excluded, and 0 of 30 with this change. Related: ClickHouse#121703 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Internal second-model review: adjudication log (click to expand)Pre-publication review by an independent model (engine: codex; 1 finding) and my own review (1 finding).
Severity: ❌ blocker / Session id: cron:clickhouse-review-slot-11:20260927-130114 |
|
Workflow [PR], commit [3fdeff9] Summary: ✅ AI ReviewSummaryThis PR narrows Findings
Tests
Final Verdict
|
| `table` | ||
| FROM system.tables | ||
| WHERE engine != 'Merge' AND (engine != 'Proxy' OR create_table_query NOT ILIKE '%merge%') | ||
| WHERE engine != 'Merge' AND (engine != 'Proxy' OR create_table_query NOT ILIKE '%merge%') AND engine NOT IN ('TableProxy', 'Alias') |
There was a problem hiding this comment.
The predicate change makes sense, but the PR still does not prove the behavior it is relying on. 00076 still only checks 1 1 1, and none of the lazy-load tests runs this size query and then asserts that the target stays TableProxy. If someone later drops either TableProxy or Alias from this filter, the regression only comes back as a probabilistic parallel CI flake.
Please add a small focused .sh regression test that creates a lazy_load_tables database plus an Alias to an unloaded target, runs the same system.columns size query, and then checks that system.tables still reports the target as TableProxy.
Related: #121703
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
The test
00076_system_columns_bytesno longer reads the column sizes ofTableProxyandAliastables, so its server-wide read no longer loads lazily loaded tables that concurrent tests expect to be still unloaded.Description
05153_alias_truncate_lockfailed its lazy-target precondition while every arm matched: job, report (mt_i/rmt_jreadMergeTree/ReplicatedMergeTreeinstead ofTableProxy). The job's server log shows the concurrent 00076 query loading both tables after the test'sATTACH DATABASEand before its check read them. It is 1 red in about 3,000 runs since #121703 added the check.00076 sums the column sizes of every table on the server. Reading the sizes of a table in a
lazy_load_tablesdatabase that is not loaded yet (engineTableProxy) loads it, and anAliasreads the sizes of its target. 05153's aliases are reached before its lazy database, and the log's load order (mt_i,rmt_j,log_k) is the alias one.I exclude
TableProxyandAliasin the test'ssystem.tablessubquery, next to itsMerge/Proxyexclusions. TheINset filters the tables before any size is read, so nothing is loaded. AnAliashas no data of its own, and an already loaded lazy table is still summed. Fixing 00076 rather than 05153 also covers the five other parallel tests that checkTableProxyafter re-attaching a lazy database; 00076 is the only parallel test that reads sizes server-wide.Validation, 05153 under a background loop issuing 00076's query: 14/30 runs failed with the old query, 11/30 with only
TableProxyexcluded, 0/30 with this change (a loader query started inside the vulnerable window in 22 of the 30). Injecting the query right after 05153 creates its aliases fails it 3/3 with the old query or either exclusion alone, and passes 3/3 with both. 00076 passes 50/50 randomized runs.The open #113389 makes these reads stop loading unloaded tables; once it is merged, this exclusion is no longer needed.
Workflow [PR]
Sync PR [sync-upstream/pr/122532]
Version info
26.10.1.844-master(included in26.10and later)