Repository navigation
Leave no stale readonly reader behind in tests 05104, 05227 and 05228 - #124342
Conversation
The Stress test runs the server-side AST fuzzer on every successful statement, DDL included (`ast_fuzzer_runs = 5`, `ast_fuzzer_any_query = true`). After `CREATE TABLE reader ... disk(readonly = true, ...)` it creates `reader__fuzz_N`: more readonly tables over the same `table_disk` root, each attached with the writer's parts of that moment, and nothing drops them. The test's `DROP TABLE writer SYNC` then deletes the objects of those parts, and later reads of the clones in the kept stress database (fuzzed reads, 02046's `merge(currentDatabase(), '') FINAL`) fail with `S3_ERROR The specified key does not exist` on `data.packed`, which the stress `No such key` check reports (PR ClickHouse#118957, Stress test (arm_release)). 05227 and 05228 build the same readonly reader over a writer they drop. In 05228 the reader `DROP` also runs after the writer's drop has finished, so a reader `DROP` ignored by `ignore_drop_queries_probability` (it becomes a TRUNCATE of a read-only table and fails with TABLE_IS_PERMANENTLY_READ_ONLY) leaves a stale reader as well, and an ignored background writer `DROP` makes the test wait forever in `SYSTEM WAIT FAILPOINT ... PAUSE`. In 05104 and 05227 both drops share one multi-statement block, so an ignored reader `DROP` stops the block before the writer drop; the pin there keeps the block's drops. Pin `ast_fuzzer_any_query = 0` in the sessions that create the tables and `ignore_drop_queries_probability = 0` in the sessions that drop them. Only the SELECTs of those sessions stay fuzzed; the ALTERs and OPTIMIZE of 05104 run in other sessions and stay fuzzed too. Measured locally with the Stress fuzzer settings and one fixed database per run: 05104 left fuzzer clones in 13 of 87 databases before (816 fuzzed clone CREATEs, the CI error reproduced by the 02046-style read in 4), none after (0 fuzzed CREATEs in 80 runs); 05228 likewise. In 05227 a clone survives only when the fuzzer drops the copied UUID clause (19 of 414 reader attempts in 05104 did); none of its 47 did in 10 runs, and after the change it makes no fuzzed CREATE in 10 runs. 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; 3 findings in the first pass, 0 in the delta recheck after one fix round) plus my own review.
Noted, not blocking: the server-side fuzzer can rewrite Severity: ❌ blocker / Session id: cron:clickhouse-review-slot-8:20261007-003100 |
Pre-PR validation gate (click to expand)
Session id: cron:clickhouse-impl-slot-4:20261007-000100 |
|
Workflow [PR], commit [f48651f] Summary: ✅ AI ReviewSummaryThe three tests disable DDL fuzzing during table creation, prevent ignored cleanup drops, and use a fresh readonly disk for each run to avoid stale metadata on retries. No remaining findings. The two prior cleanup findings are withdrawn: Final VerdictStatus: ✅ Approve |
clickhouse-test retries a failed test whose output has a retriable message (`MESSAGES_TO_RETRY`, e.g. `(total) memory limit exceeded`), and a Stress worker with a fixed `--database=test_<i>` runs the retry in the same database without cleaning it, so the retry starts from what the earlier attempt left. The startup `DROP TABLE IF EXISTS` statements still ran under the stress `ignore_drop_queries_probability = 0.2`. When the writer `DROP` runs and the `DROP` of a leftover readonly reader is ignored (it becomes a TRUNCATE and fails with TABLE_IS_PERMANENTLY_READ_ONLY), the reader stays over the objects the writer removed. Pin the setting there as well. The retry also reused the readonly disk of the earlier attempt by name, and that disk keeps the listing it loaded: the new reader attached the parts of the earlier attempt, which are gone, and the server logged `Code: 499 ... The specified key does not exist` for each of them. Give the reader disk a new name in every run. Measured on a local server. With the leftover writer and reader of an interrupted run, the old startup block left the reader over removed objects in 9 of 50 runs, and in none with the pin. Three runs of each test in one database: before, every rerun failed (05227 hung) and the server logged 40, 4 and 8 such lines; with the pin alone the same; after, 3 of 3 pass with none. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
This also fails on master, through a third reader of the clones: in Stress test (arm_msan), |
…fuzzer-clones-of-table-disk-readers
alexey-milovidov
left a comment
There was a problem hiding this comment.
Acceptable. I see no other way to avoid "no such key" with completely independent readers and writers.
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Not required.
Description
Stress test (arm_release) on #118957 fails
S3_ERROR No such key: reads oftest_3.reader__fuzz_{2,3,4}getThe specified key does not existondata.packedof partall_1_6_1_16.Those tables are clones of the test's readonly
reader, made by the server-side AST fuzzer (ast_fuzzer_any_query = truein Stress). Each one attaches the writer's parts of that moment, and nothing drops it. The test's ownDROP TABLE writer SYNCthen deletes the objects (no hard-link refcount is involved), and later reads of the clones in the kept database (the fuzzer,02046'smerge(currentDatabase(), '') FINAL) fail. 05227 and 05228 have the same shape. In 05228 the readerDROPalso runs after the writer's drop has finished, so an ignored one (ignore_drop_queries_probability = 0.2) leaves a stale reader too, and an ignored background writerDROPmakes the test wait forever inSYSTEM WAIT FAILPOINT.The change is test-only. The sessions that create the tables set
ast_fuzzer_any_query = 0, and the sessions that drop them setignore_drop_queries_probability = 0. Only the SELECTs of those sessions stay fuzzed; the ALTERs and OPTIMIZE of 05104 run in other sessions and stay fuzzed too. Stress retries a failed test in the same kept database, so the startup drops are pinned too, and each run gives its readonly disk a new name: a registered readonly disk keeps the listing it loaded, and a retry attached the earlier run's removed parts (Code: 499). If you prefer, the server-side fuzzer could instead drop the__fuzz_Nclones of a dropped table, as the client fuzz loop does.Validation
On a local server with the Stress fuzzer settings, one fixed database per run, as in Stress:
CREATEs in 87 runs, clones left in 13 databases, andmerge(currentDatabase(), '') FINALgives the CI error in 4. After: 0 fuzzedCREATEs in 80 runs, no table left.CREATEs.CREATEin 10 runs.ignore_drop_queries_probability = 1).The specified key does not existlines; after, 3 of 3 pass with none. With an interrupted run's tables left over, the old startup block leaves the reader over removed objects in 9 of 50 runs; with the pin, none.50 randomized runs of each test pass on a regular server; references are unchanged.
Workflow [PR]
Sync PR [sync-upstream/pr/124342]
Version info
26.11.1.1479-master(included in26.11and later)