Repository navigation
Leave only loadable objects behind in 05316_named_collection_dictionary_override_access - #124075
Conversation
…ry_override_access The test locked `table` of its collection with `ALTER NAMED COLLECTION ... NOT OVERRIDABLE` while the stored dictionaries `dict_override` and `dict_alias` override that key, and never unlocked it. The lock is checked on every dictionary load since ClickHouse#123133, so from that point those dictionaries can only be dropped. The Stress test keeps test databases across its final restart, ignores `DROP DICTIONARY` with `ignore_drop_queries_probability = 0.2`, and its server-side AST fuzzer clones every successful CREATE to `<name>__fuzz_N`, which the cleanup never drops. Either way the restart with `async_load_databases = false` refused the dictionary (Code 36 "Override not allowed for 'table'") and the whole Stress job was lost. The table part had the same window: a client killed between a lock and its unlock left a table attached, or detached non-permanently, with its key locked. The server behaviour is intended and unchanged; the test now never stores an object that overrides a locked key: - the dictionary lock check runs against a separate collection created NOT OVERRIDABLE, which no stored dictionary overrides; - each table is detached PERMANENTLY before its key is locked and attached again only after the key is unlocked (startup skips a permanently detached table, and the flag survives the rejected ATTACH), as in 04512_remote_missing_named_collection; - the client that creates the tables sets `ast_fuzzer_any_query = 0`, so the fuzzer makes no clone of them. Every assertion and the reference are unchanged. 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; 0 findings) plus a separate cold review of the diff (0 blocking findings).
Severity: ❌ blocker / Session id: cron:clickhouse-review-slot-9:20261005-175500 |
Pre-PR validation gate (click to expand)
Session id: cron:clickhouse-impl-slot-41:20261005-163100 |
|
Workflow [PR], commit [ee3e336] Summary: ✅ AI ReviewSummaryThis PR hardens Missing context / blind spots
Final Verdict✅ No new findings. The current version addresses the previously reported cleanup nondeterminism and unloadable-leftover states. |
Each attach_is_rejected() call opens fresh client sessions, so the SET ast_fuzzer_any_query = 0 of the table-creation block did not reach its DETACH ... PERMANENTLY, the rejected ATTACH or the final unlock and ATTACH, and under the Stress profile those statements were still fuzzed. Pin the setting in all three invocations, as the table-creation block and 04318/04320/04626 do, so that the test's guarantee (no stored table is attached while its key is locked) does not depend on which mutations the fuzzer applies to table DDL. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ping it A client killed between `DETACH TABLE ... PERMANENTLY` and the re-`ATTACH` in `attach_is_rejected` left the table detached permanently. `DROP TABLE IF EXISTS` does not see such a table and the name stays reserved, so every later run of the test in the same database (as in the stress test) failed at `CREATE TABLE` with `TABLE_ALREADY_EXISTS (detached permanently)`. The cleanup also dropped the named collection, after which the table could not be attached at all. The cleanup now makes the keys overridable again and attaches such a table before the drops, with the AST fuzzer off for those statements. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Under the Stress profile an ignored DROP TABLE of the URL table succeeds without dropping it, and the fuzzer then replays it as a non-permanent DETACH. A detached table registers no named-collection dependency, so the following DROP NAMED COLLECTION succeeds, and the next restart cannot load the table (NAMED_COLLECTION_DOESNT_EXIST). Co-Authored-By: Claude Opus 5.5 <[email protected]>
The stress runner sets `ignore_drop_queries_probability = 0.2`. In the cleanup it ignores `DROP DICTIONARY` and the `DROP TABLE` of the URL table, so the named collection drops after them fail with `NAMED_COLLECTION_IS_USED`, and it rewrites the `DROP TABLE` of the MySQL table into a `TRUNCATE` that `StorageMySQL` does not implement. Pin it to 0 in the cleanup's drop session, as 04920, 04401 and 05054 do. Measured on a server with the Stress settings, 30 runs per arm: before, 5 ignored drops, 10 rewrites to `TRUNCATE` (2 failed with `NOT_IMPLEMENTED`) and 6 `NAMED_COLLECTION_IS_USED`; after, none, and all 822 cleanup drops ran with the probability at 0. The restart is READY on both arms. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Could this PR get The test file on 26.9, 26.8 and 26.3 is identical to master's version right before this PR (blob |
Backport #124075 to 26.8: Leave only loadable objects behind in `05316_named_collection_dictionary_override_access`
Backport #124075 to 26.9: Leave only loadable objects behind in `05316_named_collection_dictionary_override_access`
Backport #124075 to 26.3: Leave only loadable objects behind in `05316_named_collection_dictionary_override_access`
…d in `05316_named_collection_dictionary_override_access`
Backport #124075 to 26.7: Leave only loadable objects behind in `05316_named_collection_dictionary_override_access`
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Not required.
Description
After this test ran, the Stress test could not restart the server: Stress test (amd_msan),
Load job 'load table test_1.dict_override' failed: Code: 36 ... Override not allowed for 'table'.The test locked
tableof its collection withALTER NAMED COLLECTION ... NOT OVERRIDABLEwhile two stored dictionaries overrode it, and never unlocked it. Since #123133 the lock is checked on every load, so those dictionaries could only be dropped. Stress keeps test databases across its restart, ignoresDROP DICTIONARYwithignore_drop_queries_probability = 0.2, and its server-side AST fuzzer leaves__fuzz_Nclones that the cleanup never drops. The table part has the same window when a client is killed between a lock and its unlock.The server behaviour is intended and unchanged. Only the test changes, and it keeps every assertion:
NOT OVERRIDABLE, which no stored dictionary overrides;PERMANENTLYbefore its key is locked and attached again only after the key is unlocked, like04512_remote_missing_named_collection;ast_fuzzer_any_query = 0.Validation
On a local server with the Stress settings (
ast_fuzzer_runs = 5,ast_fuzzer_any_query = 1,async_load_databases = false), the test was run in a kept database and the server was restarted:DROPignored: before, the restart fails with the CI error ondict_override; after, it starts and the leftover dictionaries load.ignore_drop_queries_probability = 0.2, killing at most one client per run: before, 3 of 5 restarts fail (on a fuzzer clonedict_alias__fuzz_N, or ontable_settings_overridewhen the kill lands in the table part); after, all 3 restarts succeed (264 runs, every client call of the test killed in at least one run).CREATE TABLEstatements: 60 from 12 executions before, 0 from 35 after.With the normal runner: 50 randomized parallel runs pass, the neighbouring named collection tests pass, and the test fails if either lock is removed.
Workflow [PR]
Sync PR [sync-upstream/pr/124075]
Version info
26.10.1.1634-master(included in26.10and later)26.9.22.5,26.8.31.5,26.7.37.11,26.3.57.3