CI found this [1]
[ 382620 ] {} <Error> Application: Caught exception while loading metadata: Code: 60. DB::Exception: Table test_25.join doesn\'t exist: While processing _CAST(joinGet(test_25.join, \'m\', CAST(\'42\', \'int\')) AS m_tmp_alter1351896088559986425, \'Int32\') AS m: default expression and column type are incomp
[ 382620 ] {} <Error> Application: Code: 60. DB::Exception: Table test_25.join doesn\'t exist: While processing _CAST(joinGet(test_25.join, \'m\', CAST(\'42\', \'int\')) AS m_tmp_alter1351896088559986425, \'Int32\') AS m: default expression and column type are incompatible.: Cannot attach table `test_25`.`t
[1]: https://s3.amazonaws.com/clickhouse-test-reports/48670/d7f865037266ed87538cf4df7ec7e8165681871b/stress_test__asan_.html
The problem here is that after failed RENAME dependencies got lost:
[4e937f39d866] 2023.04.12 00:51:06.833624 [ 13419 ] {61429225-64cb-4fce-b60d-01e0dac6e52c} <Error> executeQuery: Code: 241. DB::Exception: Memory limit (total) exceeded: would use 34.65 GiB (attempt to allocate chunk of 2097419 bytes), maximum: 34.29 GiB. OvercommitTracker decision: Memory overcommit has freed not enough memory. (MEMORY_LIMIT_EXCEEDED) (version 23.4.1.1) (from [::1]:45710) (comment: 01160_table_dependencies.sh) (in query: create database test_25_1), Stack trace (when copying this message, always include the lines below):
[4e937f39d866] 2023.04.12 00:51:07.351914 [ 5151 ] {66d8bdd4-668e-4239-a8af-6b8f17bb5222} <Error> executeQuery: Code: 81. DB::Exception: Database test_25_1 doesn't exist. (UNKNOWN_DATABASE) (version 23.4.1.1) (from [::1]:45762) (comment: 01160_table_dependencies.sh) (in query: rename table t to test_25_1.t), Stack trace (when copying this message, always include the lines below):
And from the test output:
OK
OK
OK
OK
a [] [] []
data_02344 [] [] []
date_table [] [] []
dict1 [] ['dict_src'] ['join']
dict2 [] ['join'] []
dict_src [] [] ['dict1']
dist_02346 [] [] []
join [] ['dict1'] ['dict2','s']
^^^^^^^^^^^^^ no "t"
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
It looks redundant, since sendQuery() cannot be executed in parallel
with processPacket() (hence RemoteQueryExecutor::setPartUUIDs())
This likely will fix the lock-order-inversion in RemoteQueryExecutor,
since I think it is false-positive.
Fixes: #48534
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>