Skip to content

Keep DDL out of the AST fuzzer in 05234_read_only_disk_hard_links_capability - #125307

Merged
alexey-milovidov merged 1 commit into
ClickHouse:masterfrom
groeneai:keep-ddl-out-of-ast-fuzzer-in-05234-read-only-disk-hard-links
Oct 12, 2026
Merged

alexey-milovidov merged 1 commit into
ClickHouse:masterfrom
groeneai:keep-ddl-out-of-ast-fuzzer-in-05234-read-only-disk-hard-links

Conversation

@groeneai

@groeneai groeneai commented Oct 12, 2026 •

Copy link
Copy Markdown
Collaborator

Related: #124342

Changelog category (leave one):

  • CI Fix or Improvement (changelog entry is not required)

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

Not required.

Description

Stress test (amd_debug) on #124763 could not restart the server: Load job 'load table test_7.reader_hard_links__fuzz_4' failed: Code: 4 ... Index file all_1_1_0/primary.cidx is unexpectedly long.

That table is a clone of the test's read-only reader_hard_links, made by the server-side AST fuzzer (ast_fuzzer_any_query = true in Stress) with key Array(Int32) over the writer's Int32 part. Its CREATE passed only because the primary index prewarm hit the original reader's cache entry, which is keyed by disk name and part path; after the restart the cache is empty and the clone's own index load fails. A table_disk reader that declares other columns over the same parts is documented as unsupported (#119295). The cleanup did not remove the part either: ignore_drop_queries_probability = 0.2 turned DROP TABLE reader SYNC into a TRUNCATE, which a read-only table rejects with Code: 774, so the rest of that block never ran.

The change is test-only, the same shape as #124342: the two sessions that create the tables set ast_fuzzer_any_query = 0, ignore_drop_queries_probability = 0, and the cleanup session sets ignore_drop_queries_probability = 0. The SELECT, CREATE HYPOTHETICAL INDEX and cleanup DROP queries stay fuzzed. The other tests with a read-only table_disk reader have shown no such failure in 90 days, so they are unchanged. Alternatively, the primary index cache key could include the table, which makes such a clone fail at CREATE.

Validation

Local server with the Stress fuzzer settings, use_primary_key_cache = prewarm_primary_key_cache = 1, --client-option ignore_drop_queries_probability=0.2, one kept database as in Stress, then a restart with async_load_databases = false:

  • Before, two arms (21 and 10 runs): 167 and 114 fuzzed clone CREATEs, 10 and 11 clones left, and 3 of 3 restarts failed, 2 of them with the CI error.
  • After: 0 fuzzed clone CREATEs, no table left, 5 of 5 restarts start.
  • Removing the SET of the second block brings back 354 clone CREATEs and 20 leftover clones; ignore_drop_queries_probability = 1 in the cleanup brings back Code: 774 and leaves all four tables.
  • The CI's clone DDL over the test's tables is accepted, and the restart then fails with the CI error (4 of 4 once the original reader is gone).

50 randomized runs pass on a regular server and 20 on the fuzzer profile; the reference is unchanged.


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

Version info

  • Merged into: 26.10.1.2226-master (included in 26.10 and later)

…ability

Stress test (amd_debug) on ClickHouse#124763 could not restart the server: the load of
`test_7.reader_hard_links__fuzz_4` failed with `Code: 4 ... primary.cidx is
unexpectedly long`. That table is a clone of the test's read-only reader made
by the server-side AST fuzzer (`ast_fuzzer_any_query = true` in Stress) with
`key Array(Int32)` over the writer's `Int32` part. The clone's CREATE passed
only because its primary index prewarm hit the original reader's cache entry,
which is keyed by disk name and part path; after the restart the cache is
empty and the clone's own index load fails. Such a misdeclared `table_disk`
reader is documented as unsupported.

The part survived because the cleanup aborted at its first statement: the
fault-injected `ignore_drop_queries_probability = 0.2` turns `DROP TABLE
reader SYNC` on a read-only table into a TRUNCATE, which fails with
`Code: 774`, so the writers were never dropped.

Set `ast_fuzzer_any_query = 0, ignore_drop_queries_probability = 0` in the
two sessions that create the tables and `ignore_drop_queries_probability = 0`
in the cleanup session, as for 05104, 05227 and 05228. SELECTs, hypothetical
indexes and the cleanup DROPs stay fuzzed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@groeneai groeneai added can be tested Allows running workflows for external contributors groeneai-origin-ci-master PR origin: master/nightly CI monitoring finding labels Oct 12, 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; 0 findings) plus my own cold review (3 nits, none blocking).

# Sev Finding Verdict Evidence / action
1 💡 05175_table_disk_parts_disagree_with_sorting_key has the same writer plus read-only reader shape noted, not changed 0 such restart failures in 90 days in CIDB; listed in the description
2 💡 The Related: link sat inside the template comment AGREE, fixed in the description none
3 💡 A rerun of this test in the same database fails on master too (the read-only disk keeps the first run's listing) noted, not raised Stress runs each test once per worker and does not check that error; no restart impact measured

Severity: ❌ blocker / ⚠️ major / 💡 nit.

Session id: cron:clickhouse-review-slot-10:20261012-031700

@groeneai

Copy link
Copy Markdown
Collaborator Author
Pre-PR validation gate (click to expand)
# Question Answer
a Deterministic repro? Yes. The CI's clone DDL (reader_hard_links__fuzz_4, key Array(Int32), same read-only disk) over the test's tables is accepted, and a restart with async_load_databases = false then fails with the CI line in 4 of 4 runs once the original reader is gone. At test level, every restart after a run of the unchanged test under the Stress fuzzer settings failed (3 of 3, two arms).
b Root cause explained? The server-side AST fuzzer replays the test's CREATE TABLE as <name>__fuzz_N with other key types over the shared parts; the clone passes CREATE because its primary index prewarm hits the original reader's cache entry (keyed by disk name and part path); the cleanup aborts because a fault-injected DROP of the read-only reader becomes a TRUNCATE (Code: 774), so the writer's part stays; after the restart the clone loads primary.cidx with its own key type and fails.
c Fix matches root cause? Yes. The DDL sessions set ast_fuzzer_any_query = 0 (no clone can exist) and every session that drops sets ignore_drop_queries_probability = 0 (the parts are removed). A reader declaring other columns over the same parts is documented as unsupported for table_disk, so this is a test fix.
d Test intent preserved / new tests added? Yes. Statements and reference unchanged; the SELECT, CREATE HYPOTHETICAL INDEX and cleanup sessions stay fuzzed (102 to 332 fuzzed SELECTs per arm). Test-only change, no new test.
e Both directions demonstrated? Yes. Before: 167 and 114 fuzzed clone CREATEs, 10 and 11 clones left, restarts 3 of 3 fail. After: 0 clone CREATEs, no table left, restarts 5 of 5 start. Negative controls: dropping one block's SET brings back 354 clone CREATEs; probability 1 in the cleanup brings back Code: 774 and all four tables.
f Fix is general across code paths? All four tables of both DDL blocks and the cleanup are covered. Other tests with a read-only table_disk reader showed no such failure in 90 days and are unchanged.
g Fix generalizes across inputs (params/datatypes/wrappers)? N/A (test-only setting pin).
h Backward compatible? (maintainer-approved exception only) N/A (test-only).
i Invariants and contracts preserved? No table the test creates outlives it with a schema that differs from the parts under its root, and its cleanup always removes the writers' parts: no table left after every run with the change, in a kept and in fresh databases. 50 of 50 randomized runs pass.

Session id: cron:clickhouse-impl-slot-6:20261012-024100

@clickhouse-gh

clickhouse-gh Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [23135ad]

Summary: ✅


AI Review

Summary

This PR pins ast_fuzzer_any_query and ignore_drop_queries_probability around the table-creation and cleanup DDL in 05234_read_only_disk_hard_links_capability.sh so the stress profile no longer leaves incompatible __fuzz_N table clones or a failed read-only TRUNCATE behind. The change matches the reported restart failure, preserves the test's intent, and I do not see an unresolved correctness or coverage regression in the current patch.

Final Verdict

Status: ✅ Approve

@clickhouse-gh clickhouse-gh Bot added the pr-ci label Oct 12, 2026
@groeneai
groeneai requested a review from Michicosun October 12, 2026 03:43
@clickhouse-gh clickhouse-gh Bot added the comp-testing Test content only (no production code). label Oct 12, 2026
@alexey-milovidov alexey-milovidov self-assigned this Oct 12, 2026
@alexey-milovidov
alexey-milovidov added this pull request to the merge queue Oct 12, 2026
Merged via the queue into ClickHouse:master with commit d2fb3c1 Oct 12, 2026
173 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 Oct 12, 2026
@clickhouse-gh clickhouse-gh Bot added comp-disk-abstractions Core disk abstractions: IDisk interface, DiskLocal, storage policies, volumes, disk management to... and removed comp-testing Test content only (no production code). labels Nov 22, 2026
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-disk-abstractions Core disk abstractions: IDisk interface, DiskLocal, storage policies, volumes, disk management to... groeneai-origin-ci-master PR origin: master/nightly CI monitoring finding pr-ci 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