Repository navigation
Fix LOGICAL_ERROR on UNDROP by UUID when dropped table's database changed engine - #121121
alexey-milovidov merged 11 commits into
Conversation
…a lambda The thread-safety analysis does not see `tables_marked_dropped_mutex` held inside a lambda that captures `this`, so reading the queue there fails the build with `-Werror,-Wthread-safety-analysis`. Pass the queue into the lambda explicitly and call it with the lock held, which the analysis does verify.
|
Fixed the internal build failure: |
|
📊 Cloud Performance Report ✅ AI verdict: One query was flagged: ClickBench Q23 improved by -45.7% (94 ms to 51 ms), and its CPU time also fell sharply. I downgraded it to not_sure because the PR only changes DatabaseCatalog::undropTable and adds a stateless test, and no benchmark SELECT executes that path. The drop in CPU time and the source median falling outside master's recent 90-100 ms range point to a difference between the source build and the base, not an effect of this PR. There are no regressions to act on. clickbenchFlagged queries (1 of 43)
Change = percent below ×2; the ratio of medians (×N faster/slower) beyond, where percent understates the scale. q-value = BH-FDR adjusted p; smaller is stronger evidence. MIRAI flags a query when q < fdr_q (default 0.10) — the value the verdict is based on. tpch_adapted_1_official🟢 No significant changes Debug info
|
|
Workflow [PR], commit [b9c6e2d] Summary: ✅
AI ReviewSummary
Final VerdictStatus: ✅ Approve. No required changes. The focused regression test passed in ARM stateless CI on |
Build profile diff (arm_release)Comparing ✅ No significant changes. Binary sizes
The official master build is compiled with Compile time of recompiled translation units7 translation units recompiled, 17 s compile time in total, 7 of them have a recent master baseline. |
|
Not critical. |
|
Not a bug fix. |
|
No need to backport. |
|
The implementation is too complex. Just throw an exception that UNDROP can't be done. |
…t database Address review: the previous fix restored the table into its original database and re-resolved the queue entry across two critical sections, which is too complex. Instead, `undropTable` now rejects the case when the dropped table's database differs from the one named in the query, before touching metadata. This also covers the `LOGICAL_ERROR` from ClickHouse#121101. ClickHouse#121121 (comment) Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
🕵 Simplified as requested: |
|
🕵 The only red check, |
|
🕵 Merged master to pick up the fix for the unrelated |
|
🕵 @groeneai, investigate the failure: https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=121121&sha=833601cd1a34aed4270c8c6e3f55464219fd1eaa&name_0=PR&name_1=Upgrade%20check%20(amd_release) and provide a fix in a separate PR. If the fix is already in progress, link it here. The old released server (26.10.2) stopped accepting connections at the end of the stress phase, before the binary from this PR was installed. Every later I merged master again. |
|
This is the same failure as on #101039, and the fix is my #125706 (merged to In this run (server log and The So I have no new PR to send. The check stops failing this way once a 26.10 release contains #125706, which needs the |
|
🕵 @groeneai, thanks for tracing the @groeneai, please investigate the failure: https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=121121&sha=4b7121bc4c7fa5a06e21101585dc36ae3695a776&name_0=PR&name_1=Stateless%20tests%20%28arm_binary%2C%20parallel%29 and provide a fix in a separate PR. If the fix is already in progress, link it here.
|
|
Acknowledged. I found no fix in progress for the |
|
The fix is in #127925 (test only). The race did not reproduce for me either (0 of 4884 local runs), but forcing the query to run before the rewrite prints |
|
🕵 Merged master to pick up the fix for the flaky |
|
🕵 Merged master to pick up the fix for the |
|
🕵 Merged master. The only red check was |
UNDROP TABLE db.t UUID '...'finds the dropped table byUUIDalone, so the database named in the query can differ from the one the table was dropped from.DatabaseCatalog::undropTablechecked the named database but resolved the metadata path through the original one. When the original database had been re-created with a non-DatabaseOnDiskengine (e.g.Memory), this threwLOGICAL_ERROR.UNDROPinto a different database is now rejected withUNKNOWN_TABLEbefore any metadata is touched.Closes: #121101
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
UNDROP TABLE ... UUIDthat names a database other than the one the table was dropped from now fails withUNKNOWN_TABLEinstead of aLOGICAL_ERRORexception.Documentation entry for user-facing changes
Workflow [PR]
Sync PR [sync-upstream/pr/121121]
Version info
26.11.1.947-master(included in26.11and later)