Skip to content

Keep the stress AST fuzzer and ignored DROPs out of 05496_dynamic_disk_wrapper_of_server_credentials_disk - #130670

Merged
alexey-milovidov merged 1 commit into
ClickHouse:masterfrom
groeneai:fix-05496-stress-fuzzer-leftovers
Nov 11, 2026
Merged

alexey-milovidov merged 1 commit into
ClickHouse:masterfrom
groeneai:fix-05496-stress-fuzzer-leftovers

Conversation

@groeneai

@groeneai groeneai commented Nov 11, 2026 •

Copy link
Copy Markdown
Collaborator

Related: #129044

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

Since #129044 merged, Stress test (*) often cannot restart the server (Cannot start clickhouse-server): 11 runs on 6 flavours, including master and 26.10. Every one fails to load a table of 05496, e.g.:

Code: 478. DB::Exception: Unknown storage policy `__plain_test_1`: Cannot parse definition from metadata file store/.../created__fuzz_84.sql. (UNKNOWN_POLICY)

The stress profile sets ast_fuzzer_any_query (tests/docker_scripts/stress_tests.lib), so the server replays the test's CREATEs as created__fuzz_N / t_policy__fuzz_N. The test drops only created and t_policy. The copies name, by reference, disks and storage policies that only the dropped tables defined, or resolve them through Keeper nodes the test removes at the end. After the restart nothing defines those names. Stress also passes ignore_drop_queries_probability=0.2 (ci/jobs/scripts/stress/stress.py), and an ignored DROP of created or t_policy leaves a table that cannot be loaded either.

The test's client now pins --ast_fuzzer_any_query=0 --ignore_drop_queries_probability=0 (the same pair as 05321_sqlite_pushdown_enum_constant). No query or .reference changes.

Validated on a local debug server with the CI config and the stress fuzzer profile, restarting with async_load_databases = false. Unpatched: 8 copies left and the restart fails with the error above; with every DROP ignored it fails on t_policy.sql. Patched: no copies, no ignored DROPs, the restart succeeds, while the unpatched file on the same server still leaves 14 copies. 50/50 randomized runs pass.

#129044 is also on 26.8, 26.9 and 26.10 (#130471, #130472, #130473), so this needs the same backports. Reverting #129044 and those backports would also stop the failures; I did not choose that because the defect is only in the test.


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

Version info

  • Merged into: 26.11.1.1989-master (included in 26.11 and later)
  • Backported to: 26.10.5.46, 26.9.31.11, 26.8.39.10

The stress `default` profile sets `ast_fuzzer_runs = 5` and
`ast_fuzzer_any_query = true`, so every successful CREATE of
05496_dynamic_disk_wrapper_of_server_credentials_disk is replayed as
`created__fuzz_N` / `t_policy__fuzz_N`. The test drops only `created` and
`t_policy`, and the copies name by reference the disks and storage policies
(`plain_<db>`, `server_<db>`, `__plain_<db>`, `__server_<db>`) that only the
dropped tables defined, or resolve them through Keeper nodes the test removes
at the end. After the post-stress restart nothing defines those names, the
copy's metadata cannot be parsed and the server does not start
(`Cannot start clickhouse-server`, 11 Stress rows since ClickHouse#129044 merged,
including master and the 26.10 backport branch).

Stress also passes `ignore_drop_queries_probability=0.2` to every client, and
an ignored DROP of `created` or `t_policy` leaves a table that cannot be
loaded after the restart either.

Pin `--ast_fuzzer_any_query=0 --ignore_drop_queries_probability=0` on the
test's client (the same pair as 05321). With `ast_fuzzer_any_query = 0`
`executeASTFuzzerQueries` returns early for every non-read-only seed, and the
test issues only DDL. The appended values win over the stress client options
because clickhouse-test passes `--allow_repeated_settings` and the client
keeps the last occurrence.

Local reproduction with the stress fuzzer profile (debug build, CI config):
unpatched, 3 runs in a fixed database left 8 copies and the restart with
`async_load_databases = false` failed with `Code: 478 Unknown storage policy
__plain_test_1 ... created__fuzz_84.sql`; with every DROP ignored it failed
with `Code: 478 ... __server_test_1 ... t_policy.sql`. Patched: 0 copies,
0 ignored DROPs of the test's tables, the restart succeeds; 50/50 randomized
runs pass.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@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; 1 full pass) and my own cold review (0 findings).

# Sev Finding Verdict Evidence / action
- - No findings - -

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

Session id: cron:clickhouse-review-slot-9:20261111-014000

@groeneai

Copy link
Copy Markdown
Collaborator Author
Pre-PR validation gate (click to expand)
# Question Answer
a Deterministic repro? Yes. Local debug server with the CI config plus the stress fuzzer profile (ast_fuzzer_runs = 5, ast_fuzzer_any_query = true): 3 runs in a fixed database leave 8 __fuzz_N copies and the restart with async_load_databases = false fails with Code: 478 Unknown storage policy __plain_test_1 ... created__fuzz_84.sql. With every DROP ignored, the restart fails on t_policy.sql.
b Root cause explained? The stress fuzzer replays the test's CREATEs as copies the test never drops; they name disks, policies and Keeper nodes that only the dropped tables defined. Stress's ignore_drop_queries_probability=0.2 can leave created / t_policy the same way. After the restart nothing defines those names.
c Fix matches root cause? Yes. The test's client pins --ast_fuzzer_any_query=0 --ignore_drop_queries_probability=0, which removes both mechanisms for this test only. No assertion, query or reference change, no tag.
d Test intent preserved / new tests added? Preserved: every query and the .reference are unchanged. No new test: the signal is the stress restart, which a stateless test cannot assert.
e Both directions demonstrated? Yes, same binary: unpatched restart fails (both mechanisms), patched restart succeeds with 0 leftovers. On the same server the unpatched file still leaves 14 copies. 20/20 random-database runs and 50/50 randomized runs pass.
f Fix is general across code paths? Every client call of the test goes through the one redefinition (the run() statement and DROP, the final DROP TABLE t_policy). The sibling tests of #129044 (05494, 05495) need nothing and have no failures.
g Fix generalizes across inputs (params/datatypes/wrappers)? N/A (test-only). Both stress worker shapes checked (fixed and random database).
h Backward compatible? (maintainer-approved exception only) Yes, test-only. Needs the same backports as #129044 (26.8, 26.9, 26.10).
i Invariants and contracts preserved? The test's own invariant, that no table it creates outlives it, now holds under the stress profile. The pinned values win over the stress client options (--allow_repeated_settings, last value wins).

Session id: cron:clickhouse-impl-slot-6:20261111-010900

@clickhouse-gh

clickhouse-gh Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [dcd4723]

Summary: ✅


AI Review

Summary

The test disables DDL fuzzing and ignored DROP queries to prevent leftover tables from blocking server restarts. The PR provides before/after restart validation for both failure mechanisms. No actionable findings.

Final Verdict

Status: ✅ Approve

@alexey-milovidov alexey-milovidov self-assigned this Nov 11, 2026
@alexey-milovidov
alexey-milovidov added this pull request to the merge queue Nov 11, 2026
Merged via the queue into ClickHouse:master with commit 0723951 Nov 11, 2026
369 of 370 checks passed
@robot-clickhouse-ci-1 robot-clickhouse-ci-1 added the pr-synced-to-cloud The PR is synced to the cloud repo label Nov 11, 2026
@groeneai

Copy link
Copy Markdown
Collaborator Author

This fix is also needed on 26.8, 26.9 and 26.10. The backports of #129044 (#130471, #130472, #130473) added 05496_dynamic_disk_wrapper_of_server_credentials_disk.sh to those branches, but this fix did not go with them, and the Stress test now fails there in the same way:

The cherry-pick should apply cleanly, because the file is identical on all three branches and on this PR's base (blob ad47a415). Could v26.8-must-backport, v26.9-must-backport and v26.10-must-backport be added here?

@robot-clickhouse robot-clickhouse added the pr-backports-created Backport PRs are successfully created, it won't be processed by CI script anymore label Nov 16, 2026
clickhouse-gh Bot added a commit that referenced this pull request Nov 16, 2026
Backport #130670 to 26.9: Keep the stress AST fuzzer and ignored DROPs out of 05496_dynamic_disk_wrapper_of_server_credentials_disk
clickhouse-gh Bot added a commit that referenced this pull request Nov 16, 2026
Backport #130670 to 26.10: Keep the stress AST fuzzer and ignored DROPs out of 05496_dynamic_disk_wrapper_of_server_credentials_disk
clickhouse-gh Bot added a commit that referenced this pull request Nov 17, 2026
Backport #130670 to 26.8: Keep the stress AST fuzzer and ignored DROPs out of 05496_dynamic_disk_wrapper_of_server_credentials_disk
groeneai added a commit to groeneai/ClickHouse that referenced this pull request Nov 17, 2026
…isk in a Memory database

The stress test stops every worker at its global time limit. Worker 0
runs the tests in the runner's default descending order, so the limit
lands in the same band of newest tests on every run; on 26.8 that band
includes 05496 (4 `Stress test` jobs in 4 days, with ClickHouse#130670 present).
The test can then stop between a `CREATE TABLE` that names a disk of an
already dropped table (`disk = '<name>'`, `storage_policy =
'__<name>'`, a wrapper of `server_<db>`) and its `DROP`.
`prepare_for_hung_check` detaches, not drops, the databases, the restart
attaches them again, the table cannot be loaded (`Unknown storage policy
__server_<db>`, `Unknown disk plain_<db>`, `The wrapped disk must have
been announced earlier`) and the server does not start.

An interruption cannot be pinned by a setting, so every table of the
test now lives in a Memory database, which keeps no table metadata on
disk: after the restart it is empty, wherever the test was stopped. That
also covers a `DROP` lost to an injected memory fault, so the
`memory_tracker_fault_probability=0` pin of the previous commit is
removed again. Same shape as ClickHouse#122101 (05234) and ClickHouse#131581 (05620).

`CREATE DATABASE ... ENGINE = Memory` stays on one line: the runner's
`--replace-log-memory-with-mergetree` (stress worker 0) rewrites
`ENGINE = Memory` to MergeTree except on a line with `CREATE DATABASE`.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
mkmkme pushed a commit to Altinity/ClickHouse that referenced this pull request Nov 17, 2026
…nored DROPs out of 05496_dynamic_disk_wrapper_of_server_credentials_disk
zoomxi pushed a commit to zoomxi/ClickHouse that referenced this pull request Nov 19, 2026
…er_credentials_disk

Stress workers with `i % 5 == 1` run every test with
`memory_tracker_fault_probability=0.05`. The setting also applies to the
client's own query memory tracker, so a `clickhouse client` call can fail
with `Code: 241 ... fault injected` before it sends its query. When that
call is the cleanup `DROP` of the last `run()` or of `t_policy`, a table
that names the dynamic disk `plain_<db>` (or the policy `__server_<db>`)
survives the test. Nothing defines that disk after a restart, so the
server cannot load the table and does not start (`Code: 479 Unknown disk
plain_test_1`, seen on ClickHouse#124804 with ClickHouse#130670 already in the build).

Pin the probability to 0 for this test, next to the fuzzer and ignored
DROP pins added by ClickHouse#130670.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@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... pr-backports-created Backport PRs are successfully created, it won't be processed by CI script anymore pr-ci pr-must-backport-synced The `*-must-backport` labels are synced into the cloud Sync PR pr-synced-to-cloud The PR is synced to the cloud repo v26.8-must-backport v26.9-must-backport v26.10-must-backport

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants