Repository navigation
Keep SQLite pushdown test cleanup safe under fuzzing - #124548
Conversation
Disable DDL mutation for tables tied to the test's SQLite file and force cleanup drops to execute. Keep the backing file if a drop fails, while retaining query fuzzing. Validated the existing reference, query fuzzing with randomly ignored drops, and a server restart using the ARM64 CI binary. Related: ClickHouse#124490 CI report: https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=124490&sha=556553a5d64f1b467909bcfa9b982188ca3c6cbb&name_0=PR&name_1=Stress%20test%20%28arm_asan_ubsan%2C%20s3%29
|
Workflow [PR], commit [88aa0d8] Summary: ✅ AI ReviewSummaryThis PR hardens Missing context / blind spots
Findings
|
| ${CLICKHOUSE_CLIENT} --ast_fuzzer_any_query=0 --ignore_drop_queries_probability=0 --query "DROP TABLE IF EXISTS t_05321_check" || return | ||
| ${CLICKHOUSE_CLIENT} --ast_fuzzer_any_query=0 --ignore_drop_queries_probability=0 --query "DROP TABLE IF EXISTS t_05321" || return |
There was a problem hiding this comment.
trap cleanup EXIT does not propagate a non-zero return from cleanup into the script's exit status here. In bash these || return branches only skip rm -rf "${BASE}"; a real DROP failure still lets the test exit 0 and silently leaves t_05321* behind, which hides exactly the cleanup leak this PR is trying to surface.
Please track failure in a flag, attempt both drops unconditionally, skip deleting ${BASE} if any drop failed, and then make the trap path exit 1 (or call cleanup explicitly before normal exit) so CI still fails on leaked objects.
c530447
into
ClickHouse:master
`Stress test (amd_tsan)` on ClickHouse#79412 failed with `Cannot start clickhouse-server`: the restart could not load `test_7.in_subquery_ttl__fuzz_2`, a server-side AST fuzzer copy of the test's `TTL ... WHERE x IN (SELECT x FROM in_subquery_dist)` table, because `in_subquery_source` behind the `Distributed` table had been dropped (`Code: 60 ... Unknown table expression identifier`). Stress runs the test in the shared database `test_7`, which is loaded again on restart. The fuzzer copy is never dropped by the test and keeps `in_subquery_dist` alive, while `DROP TABLE in_subquery_source` succeeds. An ignored `DROP` (`ignore_drop_queries_probability = 0.2`) of `in_subquery_ttl` and `in_subquery_dist` leaves the original table in the same state; the fuzzer's own internal `DROP` replays mostly hide that path today, so pinning only the fuzzer would expose it. Set `ast_fuzzer_any_query = 0` and `ignore_drop_queries_probability = 0` at the top of the file, as ClickHouse#124548 did for 05321. `SELECT`s are still fuzzed. The leading `DROP TABLE IF EXISTS` lines now also drop dependents first, like the cleanup at the end: an in-place retry of a run that failed before its cleanup otherwise drops `in_subquery_source`, then stops on `in_subquery_dist`, which the leftover `in_subquery_ttl` depends on, and leaves the same unloadable table. Validated on a master debug build with restarts under `async_load_databases = false`: a surviving fuzzer copy, and the original table with only the fuzzer pin, both fail with the CI error, and so does a retry of the previous version of the file over a run cut before its cleanup (it stops with `HAVE_DEPENDENT_OBJECTS` on `in_subquery_dist`). With the change, 30 runs with the fuzzer on and every `DROP` ignored leave no tables, a run cut before the cleanup restarts cleanly, a retry over it drops every table, and 50/50 randomized runs pass. CI report: https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=79412&sha=fabad86e8e451c8e584218575118d6b2c258191d&name_0=PR&name_1=Stress%20test%20%28amd_tsan%29 Failing job: https://github.com/ClickHouse/ClickHouse/actions/runs/39813182646/job/120003879638 PR: ClickHouse#79412 Co-Authored-By: Claude Opus 5.5 <[email protected]>
The S3 ARM ASan/UBSan stress job could no longer restart the server after the SQLite pushdown test: fuzzed
MergeTreetables retainedCHECKsubqueries referencing the SQLite table after its backing directory had been removed.Keep this test's
CREATEandDROPqueries deterministic, force its cleanup drops to execute even when stress testing randomly ignores drops, and retain the SQLite files if either cleanup drop fails. Query fuzzing stays enabled.Validated on
devwith the ARM64 CI binary: the existing functional reference matched, query fuzzing withast_fuzzer_runs=5,ast_fuzzer_any_query=1, andignore_drop_queries_probability=1left no attached/detached tables or SQLite directory, and the server restarted successfully.Related: #124490
Related: #123843
CI report: https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=124490&sha=556553a5d64f1b467909bcfa9b982188ca3c6cbb&name_0=PR&name_1=Stress%20test%20%28arm_asan_ubsan%2C%20s3%29
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Keep the SQLite pushdown test's cleanup safe under AST fuzzing and randomly ignored drops.
Workflow [PR]
Sync PR [sync-upstream/pr/124548]
Version info
26.10.1.1-master(included in26.10and later)