Commit Graph

9843 Commits

Author SHA1 Message Date
Alexander Gololobov
018f768e7e Cleanups 2023-04-14 20:07:37 +02:00
Alexander Tokmakov
70c1000c22 fix some tests 2023-04-14 19:42:17 +02:00
Vitaly Baranov
567111f146
Merge pull request #48683 from azat/table-deps-fix
Fix table dependencies in case of failed RENAME TABLE
2023-04-14 17:22:14 +02:00
Dmitry Novik
cf5d9a175a Revert "Merge pull request #48760 from ClickHouse/revert-46089-background-memory-tracker"
This reverts commit a61ed33223, reversing
changes made to 5f01b8a2b5.
2023-04-14 16:34:19 +02:00
Alexey Milovidov
84cb2ff879 Added setting "use_index_for_in_with_subqueries_max_values" #2571 2023-04-14 16:12:18 +02:00
Alexander Gololobov
28d0cc974a Cleanups 2023-04-14 16:12:18 +02:00
Alexander Gololobov
0ae74ddf42 Use different types for referencing local set and set that is stored in cache shared between tasks 2023-04-14 16:12:18 +02:00
Alexander Gololobov
05a9d1cbfc Cleanups 2023-04-14 16:12:18 +02:00
Alexander Gololobov
0aa7979dd5 Unblock tests with ENGINE=Set 2023-04-14 16:12:18 +02:00
Alexander Gololobov
ae2da38549 Check that the set has been built before it is used 2023-04-14 16:12:18 +02:00
Alexander Gololobov
fbf09a1115 Fixes for new analyzer 2023-04-14 16:12:18 +02:00
Alexander Gololobov
adbe87e9d3 Fixes 2023-04-14 16:12:18 +02:00
Alexander Gololobov
0b9579bfb8 Reworked, testing 2023-04-14 16:12:18 +02:00
Alexander Gololobov
02876ed87d Share PreparedSet-s between task of the same mutation to reduce mem usage 2023-04-14 16:12:18 +02:00
Dmitry Novik
352a240a20
Merge pull request #47984 from ClickHouse/optimize-compilation
Optimize compilation
2023-04-14 15:34:46 +02:00
kssenii
ed2a5d25e5 Fix 2023-04-14 15:26:25 +02:00
kssenii
f7232ef537 Fix 2023-04-14 12:46:36 +02:00
Robert Schulze
2378df0a47
Merge pull request #48763 from ClickHouse/rs/fix-squashing
Fix squashing in query cache
2023-04-14 11:44:58 +02:00
Robert Schulze
a09db7f4f5
Fix squashing in query cache 2023-04-13 20:09:29 +00:00
Robert Schulze
43b8cbc50c
Merge pull request #48737 from ClickHouse/rs/fix-wshadow
Remove `-Wshadow` suppression which leaked into global namespace
2023-04-13 21:18:50 +02:00
Alexander Tokmakov
af1bf08663
Revert "Add MemoryTracker for the background tasks" 2023-04-13 21:05:02 +03:00
Anton Popov
5f01b8a2b5
Merge pull request #48517 from CurtizJ/fix-memory-compressed-tables
Fix storage `Memory` with enabled compression
2023-04-13 19:52:49 +02:00
pufit
abe3c9b9db
Merge pull request #48758 from ClickHouse/revert-48679-scheme-infer
Revert "Make Schema inference works for CREATE AS SELECT"
2023-04-13 13:46:30 -04:00
Anton Popov
4a1c868ca9
Merge pull request #48663 from CurtizJ/fix-async-insert-no-data
Fix async inserts with empty data
2023-04-13 19:44:47 +02:00
pufit
d717372c6e
Revert "Make Schema inference works for CREATE AS SELECT" 2023-04-13 13:35:32 -04:00
pufit
a8c892f925
Merge pull request #48679 from ucasfl/scheme-infer
Make Schema inference works for CREATE AS SELECT
2023-04-13 13:02:04 -04:00
kssenii
599a02ca0d Fix 2023-04-13 18:53:16 +02:00
kssenii
461477dabf Fix style check 2023-04-13 16:38:38 +02:00
Dmitry Novik
5cc9b46f78 Merge remote-tracking branch 'origin/master' into optimize-compilation 2023-04-13 16:04:09 +02:00
kssenii
ce723ec32d Fix style check, better priority->iterate 2023-04-13 14:45:28 +02:00
kssenii
58a30213c9 Fix after merge 2023-04-13 13:34:19 +02:00
Dmitry Novik
467ecf45e1
Merge pull request #46089 from ClickHouse/background-memory-tracker
Add MemoryTracker for the background tasks
2023-04-13 13:29:27 +02:00
kssenii
ce45105448 Cleanup a bit 2023-04-13 13:27:01 +02:00
kssenii
09c23287aa Merge remote-tracking branch 'upstream/master' into cache-better-locks 2023-04-13 13:25:45 +02:00
Raúl Marín
2b70e08f23 Don't count unreserved bytes in Arenas as read_bytes 2023-04-13 12:43:24 +02:00
Robert Schulze
7a21d5888c
Remove -Wshadow suppression which leaked into global namespace 2023-04-13 08:46:40 +00:00
Raúl Marín
da9a539cf7 Reduce the usage of Arena.h 2023-04-13 10:31:32 +02:00
pufit
aa0f3bc994 Solve pr issues 2023-04-12 20:28:17 -04:00
kssenii
b773b506b2 Better 2023-04-12 23:27:06 +02:00
Anton Popov
05a93ef123 add flush id and time for async insert with empty data 2023-04-12 20:57:55 +00:00
Alexey Milovidov
9a3030803e
Merge pull request #48596 from azat/ci/second_deadlock_stack
Add second_deadlock_stack=1 for TSan on CI and fix some lock-order-inversion problems
2023-04-12 22:11:06 +03:00
Anton Popov
08aa629e56
Merge branch 'master' into fix-memory-compressed-tables 2023-04-12 15:38:54 +02:00
Nikolai Kochetov
f66e9c5a26
Merge pull request #48427 from ClickHouse/update_sort_desc_follow_up
Update sort desc: more efficient original node search in ActionsDAG
2023-04-12 13:59:37 +02:00
Azat Khuzhin
5277c802f7 Fix table dependencies in case of failed RENAME TABLE
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>
2023-04-12 11:11:05 +02:00
flynn
ea9187511e Make Schema inference works for CREATE AS SELECT 2023-04-12 04:21:03 +00:00
pufit
078b8f5399 Small refactor, additional tests 2023-04-11 19:55:59 -04:00
Dmitry Novik
06e6794fc0 Merge remote-tracking branch 'origin/master' into background-memory-tracker 2023-04-11 15:29:35 +00:00
Anton Popov
09c66c3879 fix async inserts with empty data 2023-04-11 15:13:46 +00:00
Mikhail f. Shiryaev
89e4509e68
Merge branch 'master' into fix-memory-compressed-tables 2023-04-11 16:38:51 +02:00
Alexander Tokmakov
a1fda047f6 add docs 2023-04-11 16:32:40 +02:00
Alexander Tokmakov
dfff30e1a9 Merge branch 'master' into clusters_is_active_column 2023-04-11 16:32:15 +02:00
Anton Popov
3896375247 fix getting subcolumn from in-memory data 2023-04-11 14:26:31 +00:00
Nikolay Degterinsky
0621222737 Fix crashes with incorrect query parameters 2023-04-11 14:22:55 +00:00
Nikolay Degterinsky
f34b304707 Fixes, add test 2023-04-11 12:54:54 +00:00
SmitaRKulkarni
e2010c0257
Merge branch 'master' into zk_retry_timeout 2023-04-11 14:05:52 +02:00
Nikolay Degterinsky
7606336fd8 Merge remote-tracking branch 'upstream/master' into add_default_password_type 2023-04-11 11:59:45 +00:00
vdimir
4605d71947
Fix build src/Interpreters/InterpreterInsertQuery.h 2023-04-11 11:17:02 +00:00
Sema Checherinda
4dd86a406a
Merge pull request #48543 from azat/mv-uniq-thread-group
Use one ThreadGroup while pushing to materialized views (and some refactoring for ThreadGroup)
2023-04-11 11:47:46 +02:00
Alexey Milovidov
d259217cf3
Merge pull request #48570 from azat/build/logger_useful
Remove superfluous includes of logger_userful.h from headers
2023-04-11 03:56:39 +03:00
Nikolay Degterinsky
908be1e324 Fix tests 2023-04-10 22:04:10 +00:00
Alexey Milovidov
f4d6596eaa
Merge pull request #48577 from ClickHouse/evillique-patch-2
Don't use type conversion with String query parameters
2023-04-10 22:18:39 +03:00
Azat Khuzhin
013a3ed269 Fix possible lock order inversion in Context::setTemporaryStorageInCache()
TSan report [1]:

    WARNING: ThreadSanitizer: lock-order-inversion (potential deadlock) (pid=1)
      Cycle in lock order graph: M0 (0x7b9000000008) => M1 (0x7b90000000a8) => M0

      Mutex M1 acquired here while holding mutex M0 in main thread:
        0 pthread_mutex_lock <null> (clickhouse+0xc66a8da) (BuildId: 174c9c4bf3606a5fc390211bdc2feff052246280)
        3 std::__1::lock_guard<std::__1::mutex>::lock_guard[abi:v15000](std::__1::mutex&) build_docker/./contrib/llvm-project/libcxx/include/__mutex_base:94:27 (clickhouse+0x1d0ccb3a) (BuildId: 174c9c4bf3606a5fc390211bdc2feff052246280)
        4 DB::Context::getDisk() const build_docker/./src/Interpreters/Context.cpp:3281:21 (clickhouse+0x1d0ccb3a)
        5 DB::Context::setTemporaryStorageInCache() build_docker/./src/Interpreters/Context.cpp:927:21 (clickhouse+0x1d0cc188) (BuildId: 174c9c4bf3606a5fc390211bdc2feff052246280)
        6 DB::Server::main() build_docker/./programs/server/Server.cpp:1055:25 (clickhouse+0x148504c2) (BuildId: 174c9c4bf3606a5fc390211bdc2feff052246280)

      Mutex M0 previously acquired by the same thread here:
        0 pthread_mutex_lock <null> (clickhouse+0xc66a8da) (BuildId: 174c9c4bf3606a5fc390211bdc2feff052246280)
        3 std::__1::unique_lock<std::__1::recursive_mutex>::unique_lock[abi:v15000](std::__1::recursive_mutex&) build_docker/./contrib/llvm-project/libcxx/include/__mutex_base:122:61 (clickhouse+0x1d0cc148) (BuildId: 174c9c4bf3606a5fc390211bdc2feff052246280)
        4 DB::Context::getLock() const build_docker/./src/Interpreters/Context.cpp:690:12 (clickhouse+0x1d0cc148)
        5 DB::Context::setTemporaryStorageInCache() build_docker/./src/Interpreters/Context.cpp:922:17 (clickhouse+0x1d0cc148)
        6 DB::Server::main() build_docker/./programs/server/Server.cpp:1055:25 (clickhouse+0x148504c2) (BuildId: 174c9c4bf3606a5fc390211bdc2feff052246280)

      Muex M0 acquired here while holding mutex M1 in main thread:
        0 pthread_mutex_lock <null> (clickhouse+0xc66a8da) (BuildId: 174c9c4bf3606a5fc390211bdc2feff052246280)
        3 std::__1::unique_lock<std::__1::recursive_mutex>::unique_lock[abi:v15000](std::__1::recursive_mutex&) build_docker/./contrib/llvm-project/libcxx/include/__mutex_base:122:61 (clickhouse+0x1d0c7ce1) (BuildId: 174c9c4bf3606a5fc390211bdc2feff052246280)
        4 DB::Context::getLock() const build_docker/./src/Interpreters/Context.cpp:690:12 (clickhouse+0x1d0c7ce1)
        5 DB::Context::getPath() const build_docker/./src/Interpreters/Context.cpp:713:17 (clickhouse+0x1d0c7ce1)
        6 DB::loadDiskLocalConfig() build_docker/./src/Disks/DiskLocal.cpp:75:30 (clickhouse+0x1ce7ed8a) (BuildId: 174c9c4bf3606a5fc390211bdc2feff052246280)
        7 DB::DiskLocal::applyNewSettings() build_docker/./src/Disks/DiskLocal.cpp:491:5 (clickhouse+0x1ce7e7ef) (BuildId: 174c9c4bf3606a5fc390211bdc2feff052246280)
        8 DB::DiskSelector::updateFromConfig() const build_docker/./src/Disks/DiskSelector.cpp:92:19 (clickhouse+0x1d14088e) (BuildId: 174c9c4bf3606a5fc390211bdc2feff052246280)
        9 DB::Context::updateStorageConfiguration() build_docker/./src/Interpreters/Context.cpp:3388:49 (clickhouse+0x1d0ec002) (BuildId: 174c9c4bf3606a5fc390211bdc2feff052246280)
        ..
        17 DB::ConfigReloader::reloadIfNewer() build_docker/./src/Common/Config/ConfigReloader.cpp:149:13 (clickhouse+0x1fff4250)

      Mutex M1 previously acquired by the same thread here:
        0 pthread_mutex_lock <null> (clickhouse+0xc66a8da) (BuildId: 174c9c4bf3606a5fc390211bdc2feff052246280)
        3 std::__1::lock_guard<std::__1::mutex>::lock_guard[abi:v15000](std::__1::mutex&) build_docker/./contrib/llvm-project/libcxx/include/__mutex_base:94:27 (clickhouse+0x1d0ebf25) (BuildId: 174c9c4bf3606a5fc390211bdc2feff052246280)
        4 DB::Context::updateStorageConfiguration() build_docker/./src/Interpreters/Context.cpp:3384:21 (clickhouse+0x1d0ebf25)
        ..
        12 DB::ConfigReloader::reloadIfNewer() build_docker/./src/Common/Config/ConfigReloader.cpp:149:13 (clickhouse+0x1fff4250)

    SUMMARY: ThreadSanitizer: lock-order-inversion (potential deadlock) (/usr/bin/clickhouse+0xc66a8da) (BuildId: 174c9c4bf3606a5fc390211bdc2feff052246280) in pthread_mutex_lock
    ==================

  [1]: https://s3.amazonaws.com/clickhouse-test-reports/48596/a1272e8536265929255fdf5020836f057859e425/integration_tests__tsan__[6/6].html

Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2023-04-10 19:56:52 +02:00
Nikolay Degterinsky
def8611d2c Fix style 2023-04-10 17:05:31 +00:00
Nikolay Degterinsky
6f57a952d9 Improvements 2023-04-10 16:40:49 +00:00
Azat Khuzhin
79b83c4fd2 Remove superfluous includes of logger_userful.h from headers
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2023-04-10 17:59:30 +02:00
Nikolai Kochetov
28484cd762
Merge pull request #48522 from ClickHouse/many-mutations-memory-limit
Reduce memory usage for multiple alter delete mutations.
2023-04-10 12:50:42 +02:00
Raúl Marín
45ad555c39
Merge branch 'master' into zk_retry_timeout 2023-04-10 10:04:16 +02:00
Nikolay Degterinsky
8524f6958a
Update src/Interpreters/ReplaceQueryParameterVisitor.cpp
Co-authored-by: Alexey Milovidov <milovidov@clickhouse.com>
2023-04-10 09:09:57 +02:00
Nikolay Degterinsky
7957752128 Merge remote-tracking branch 'upstream/master' into add_default_password_type 2023-04-10 02:25:46 +00:00
Nikolay Degterinsky
64dc60a8d1 Better version, introduce ASTAuthenticationData 2023-04-10 02:20:57 +00:00
Nikolay Degterinsky
e71c7fe744
Fix 2023-04-10 03:48:58 +02:00
Nikolay Degterinsky
6b1c86c6ec
Don't use type conversion with String query parameters 2023-04-10 03:39:13 +02:00
Vitaly Baranov
62e9c419de
Merge pull request #48519 from azat/build/fwd-decl-threadpool
Use forward declaration of ThreadPool
2023-04-08 00:44:01 +02:00
Alexey Milovidov
e09e80b493
Merge pull request #48500 from CurtizJ/fix-sparse-column-query-cache
Fix query cache with sparse columns
2023-04-07 19:34:10 +03:00
Alexander Tokmakov
9ec91acef3 add some columns to system.clusters 2023-04-07 18:26:23 +02:00
Azat Khuzhin
44ae8485f1 Use one ThreadGroup while pushing to materialized views
Before this patch only the case when ThreadStatus (current_thread)
already has ThreadGroup works that way, after they will be identical in
this aspect.

But this should not affect anything, but it just make sense.

Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2023-04-07 15:37:35 +02:00
Azat Khuzhin
aacf2a0838 Move ThreadGroupSwitcher to ThreadStatus.h (out from MergeTree code)
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2023-04-07 15:32:08 +02:00
Azat Khuzhin
5b2b20a0b0 Rename ThreadGroupStatus to ThreadGroup
There are methods like getThreadGroup() and ThreadGroupSwitcher class,
so seems that this is logical.

Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2023-04-07 15:31:48 +02:00
Sema Checherinda
0503ed6fb8
Merge pull request #46668 from azat/fix-query_views_log-from-bg
Fix system.query_views_log for MVs that are pushed from background threads
2023-04-07 14:47:05 +02:00
Azat Khuzhin
011480924a Use forward declaration of ThreadPool
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2023-04-07 11:25:35 +02:00
Yakov Olkhovskiy
8d1924cc9a
Merge pull request #47962 from ClickHouse/imp-use-structure-from-insertion
Improvement and fix for use_structure_from_insertion_table_in_table_functions
2023-04-06 19:01:00 -04:00
Nikolai Kochetov
e8fb135180 Reduce memory usage for multiple alter delete mutations. 2023-04-06 19:07:53 +00:00
Anton Popov
8d1b535efb fix storage Memory with compression 2023-04-06 18:27:53 +00:00
Sema Checherinda
9d8d9e8ec9
Merge branch 'master' into fix-query_views_log-from-bg 2023-04-06 18:16:47 +02:00
Anton Popov
4757d76fbf fix query cache with sparse columns 2023-04-06 16:01:23 +00:00
Anton Popov
b5a3723c88
Merge pull request #48395 from ClickHouse/with_fill_clarification
WITH FILL clarification and cleanup
2023-04-06 17:02:57 +02:00
pufit
d1fa9596b8 Prevent execution on cluster 2023-04-06 10:56:35 -04:00
Sema Checherinda
b8729be97a
Merge pull request #47104 from CheSema/thead-group-for-merge
merge and mutation make thread group for setting memory trackers right
2023-04-06 15:46:56 +02:00
Vitaly Baranov
b45b662fe3
Merge pull request #48431 from Algunenano/system_referential_table
Don't check dependencies when renaming system tables automatically
2023-04-06 15:28:37 +02:00
Nikolai Kochetov
6c6335b686
Merge pull request #48357 from ClickHouse/fix-projections-analysis-with-analyzer
Batch fix for projections analysis with analyzer.
2023-04-06 15:13:56 +02:00
Yakov Olkhovskiy
d2e897d4b8
Merge branch 'master' into imp-use-structure-from-insertion 2023-04-06 08:52:38 -04:00
Antonio Andelic
28a33f0a47
Merge pull request #48435 from ClickHouse/kv-update-only-affected-rows
Update only affected rows in KV storage
2023-04-06 12:33:54 +02:00
Vladimir C
e7a5c96353
Merge pull request #48219 from ClickHouse/vdimir/lock_order_47072 2023-04-06 11:54:33 +02:00
Vladimir C
a2b71a0054
Merge pull request #48386 from ClickHouse/vdimir/reset-downloader-tmp-data-cache 2023-04-06 11:23:16 +02:00
Yakov Olkhovskiy
8a19ac4e73
Merge branch 'master' into imp-use-structure-from-insertion 2023-04-06 00:51:44 -04:00
pufit
144ee7aed4 Fix logic, additional tests 2023-04-05 22:52:31 -04:00
robot-ch-test-poll3
3ad0a6ac18
Merge pull request #48433 from ClickHouse/some-fixes-for-parallel-replicas
Some fixes for parallel replicas
2023-04-06 02:00:06 +02:00
Alexander Tokmakov
a154fa73f4
Merge pull request #48401 from ClickHouse/fix_00002_log_messages
Find big allocations without memory limits checks
2023-04-05 23:52:39 +03:00
Sema Checherinda
554c928534
Merge branch 'master' into thead-group-for-merge 2023-04-05 21:09:38 +02:00
Raúl Marín
1fa992f015
Merge branch 'master' into system_referential_table 2023-04-05 20:47:53 +02:00
robot-clickhouse
3d2c279859
Merge pull request #48242 from azat/better-throttling
Per-query/per-server throttling for remote IO/local IO/BACKUPs
2023-04-05 19:32:37 +02:00
kssenii
a405d06e8a Merge remote-tracking branch 'upstream/master' into cache-better-locks 2023-04-05 18:46:52 +02:00
Antonio Andelic
0260b84bc3 Update only affected rows in KV storage 2023-04-05 16:12:14 +00:00
Raúl Marín
5d9e006c46 PR comments 2023-04-05 18:04:03 +02:00
Igor Nikonov
46f7016d8c Add search alias by input name in ActionsDAG 2023-04-05 15:56:06 +00:00
Nikita Mikhaylov
3f44c6d936 Better 2023-04-05 15:19:45 +00:00
Raúl Marín
d65d00f496 Don't check dependencies when renaming system tables automatically 2023-04-05 16:15:24 +02:00
vdimir
d9abcf2f69
Reduce scope storage_policies_mutex in setTemporaryStoragePolicy 2023-04-05 13:42:49 +00:00
vdimir
01ce3baf0f
Rename Context::getTemporaryVolume to getGlobalTemporaryVolume 2023-04-05 13:42:13 +00:00
Igor Nikonov
41f6e0e7b5 More efficient original node search in ActionsDAG 2023-04-05 13:36:07 +00:00
vdimir
6f3fa33641
Add unbound flag to system.filesystem_cache 2023-04-05 13:12:20 +00:00
Nikita Mikhaylov
7b526d3df9
Always communicate with local replica through loopback interface for parallel replicas (#48246) 2023-04-05 13:32:46 +02:00
Sema Checherinda
f504cd5fed avoid race, do not set thread_group.counters.parent from query 2023-04-05 12:36:55 +02:00
Igor Nikonov
47e7e19ca9 Move suffix generation code into one function 2023-04-05 10:12:42 +00:00
vdimir
bae1286b63
Update temp_data_on_disk in shared context 2023-04-05 10:07:44 +00:00
vdimir
7fe06f8435
Do not take lock for shared context in setTempDataOnDisk 2023-04-05 09:22:09 +00:00
Azat Khuzhin
4008155a6e Add max_ prefix for backup_bandwidth settings
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2023-04-05 10:54:25 +02:00
Azat Khuzhin
61405b827d Use MAKE_DEPRECATED_BY_SERVER_CONFIG() for deprecated throttle settings
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2023-04-05 09:40:18 +02:00
Azat Khuzhin
684ecc24e2 Ignore deprecated values max_remote_{read,write}_network_bandwidth_for_server
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2023-04-05 09:40:18 +02:00
Azat Khuzhin
ad96d3c249 Do not require proper Poco Application for Context
$ yes | head | clickhouse-obfuscator --structure 'id String' --seed foo --input-format TSV --output-format TSV
    Poco::Exception. Code: 1000, e.code() = 0, Null pointer: _pInstance in file "/src/ch/clickhouse/base/poco/Util/include/Poco/Util/Application.h", line 446, Stack trace (when copying this message, always include the lines below):

    0. /src/ch/clickhouse/contrib/llvm-project/libcxx/include/exception:134: std::exception::capture() @ 0x15605622 in /src/ch/clickhouse/.cmake-debug/programs/clickhouse
    1. /src/ch/clickhouse/contrib/llvm-project/libcxx/include/exception:112: std::exception::exception[abi:v15000]() @ 0x156055ed in /src/ch/clickhouse/.cmake-debug/programs/clickhouse
    2. /src/ch/clickhouse/base/poco/Foundation/src/Exception.cpp:27: Poco::Exception::Exception(String const&, int) @ 0x2ebd2d80 in /src/ch/clickhouse/.cmake-debug/programs/clickhouse
    3. /src/ch/clickhouse/base/poco/Foundation/src/Exception.cpp:132: Poco::LogicException::LogicException(String const&, int) @ 0x2ebd3667 in /src/ch/clickhouse/.cmake-debug/programs/clickhouse
    4. /src/ch/clickhouse/base/poco/Foundation/src/Exception.cpp:134: Poco::NullPointerException::NullPointerException(String const&, int) @ 0x2ebd3da7 in /src/ch/clickhouse/.cmake-debug/programs/clickhouse
    5. /src/ch/clickhouse/base/poco/Foundation/src/Bugcheck.cpp:42: Poco::Bugcheck::nullPointer(char const*, char const*, int) @ 0x2ebc5851 in /src/ch/clickhouse/.cmake-debug/programs/clickhouse
    6. /src/ch/clickhouse/base/poco/Util/include/Poco/Util/Application.h:446: Poco::Util::Application::instance() @ 0x1ee3e6cd in /src/ch/clickhouse/.cmake-debug/programs/clickhouse
    7. /src/ch/clickhouse/src/Interpreters/Context.cpp:358: DB::ContextSharedPart::ContextSharedPart() @ 0x263b0cca in /src/ch/clickhouse/.cmake-debug/programs/clickhouse
    8. /src/ch/clickhouse/contrib/llvm-project/libcxx/include/__memory/unique_ptr.h:714: std::__unique_if<DB::ContextSharedPart>::__unique_single std::make_unique[abi:v15000]<DB::ContextSharedPart>() @ 0x26387b6e in /src/ch/clickhouse/.cmake-debug/programs/clickhouse
    9. /src/ch/clickhouse/src/Interpreters/Context.cpp:652: DB::Context::createShared() @ 0x26361a3c in /src/ch/clickhouse/.cmake-debug/programs/clickhouse
    10. /src/ch/clickhouse/programs/obfuscator/Obfuscator.cpp:1293: mainEntryClickHouseObfuscator(int, char**) @ 0x1ef6eb26 in /src/ch/clickhouse/.cmake-debug/programs/clickhouse
    11. /src/ch/clickhouse/programs/main.cpp:481: main @ 0x155e569a in /src/ch/clickhouse/.cmake-debug/programs/clickhouse
    12. ? @ 0x7ffff7dd2790 in ?
    13. __libc_start_main @ 0x7ffff7dd284a in ?
    14. _start @ 0x155e51ae in /src/ch/clickhouse/.cmake-debug/programs/clickhouse
     (version 23.3.1.2537)

Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2023-04-05 09:40:18 +02:00
Azat Khuzhin
a8c1407bc4 Use existing ServerSettings in Context instead of reading it again
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2023-04-05 09:40:18 +02:00
Azat Khuzhin
c332d290d8 Keep only one throttler for BACKUPs IO (instead of separate read/write)
There is no need in separate read/write throttling, because you cannot
write faster then read anyway, and plus this makes the code less cleaner

(and also it will allow avoid implementing throttling backups to S3,
since it does not use common S3 writer).

Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2023-04-05 09:40:17 +02:00
Azat Khuzhin
218b1f9c29 Add ability to throttle BACKUPs on per-server/backup basis
Server settings:
- backup_read_bandwidth_for_server
- backup_write_bandwidth_for_server

Query settings:
- backup_read_bandwidth
- backup_write_bandwidth

Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2023-04-05 09:39:48 +02:00
Azat Khuzhin
a25dd1d348 Add ability to throttle local IO on per-query/server basis
Server settings:
- max_local_read_bandwidth_for_server
- max_local_write_bandwidth_for_server

Query settings:
- max_local_read_bandwidth
- max_local_write_bandwidth

This is the preparation for adding ability to throttle BACKUPs

Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2023-04-05 09:39:15 +02:00
Azat Khuzhin
b3406beeb7 Add per-query network throttling
Controlled with:
- max_remote_read_network_bandwidth
- max_remote_write_network_bandwidth

Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2023-04-05 09:39:15 +02:00
Azat Khuzhin
abdb682048 Move some methods for Context into module part
This will be required later, for per-query bandwidth limiting.

Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2023-04-05 09:39:15 +02:00
Azat Khuzhin
40cb87c2ac Make remote bandwidth settings server settings
Right now those two settings are applied only at start:
- max_remote_read_network_bandwidth_for_server
- max_remote_write_network_bandwidth_for_server

Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2023-04-05 09:39:15 +02:00
pufit
8441b0a3e1 Fix comments, tests, docs 2023-04-04 20:43:15 -04:00
Alexander Tokmakov
ba65be22da fix bad error messages 2023-04-04 20:21:22 +02:00
vdimir
5966281f7c
Test WriteBufferToFileSegment with several threads 2023-04-04 18:15:27 +00:00
vdimir
61c8a9586e
Fix usage of is_unbound in FileSegment 2023-04-04 18:14:54 +00:00
Raúl Marín
0e17b3b147 Merge remote-tracking branch 'blessed/master' into zk_retry_timeout 2023-04-04 18:53:55 +02:00
Igor Nikonov
1fb0292fcb polishing 2023-04-04 16:13:21 +00:00
Igor Nikonov
5a9acac12f Clarification and cleanup 2023-04-04 16:00:09 +00:00
Azat Khuzhin
9235d1cde2 Fix system.query_views_log for MVs that are pushed from background threads
Some of such places:
- push from Buffer
- push from Distributed sends
- system.*_log workers

Before #47564 it simply does not work, but after it throws LOGICAL_ERROR
in such situation.

v2: remove expired() check after #46709 got merged
v3: use ThreadGroupStatus ctor with ContextPtr (after #47564)
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2023-04-04 17:43:10 +02:00
vdimir
50c8472c57
Reset downloader in WriteBufferToFileSegment::nextImpl 2023-04-04 15:39:25 +00:00
vdimir
999a3889d0
Revert "Reset downloader for cache file segment in TemporaryFileStream"
This reverts commit 07147771e6.
2023-04-04 14:22:33 +00:00
vdimir
07147771e6
Reset downloader for cache file segment in TemporaryFileStream 2023-04-04 13:26:24 +00:00
Kruglov Pavel
5f930aeb26
Merge pull request #48115 from save-my-heart/throw_non_parametric_function
throw exception while non-parametric functions having parameters
2023-04-04 12:05:34 +02:00
Antonio Andelic
52e4149c98
Merge pull request #47934 from ClickHouse/alternative-keeper-configs
Merge #35113
2023-04-04 09:58:33 +02:00
Antonio Andelic
d0ba1e76bf
Merge pull request #48293 from ClickHouse/keeper-map-strict-mode
Add strict mode for KeeperMap
2023-04-04 09:57:01 +02:00
Nikolai Kochetov
b327a93cf7 Add comments. 2023-04-03 18:18:39 +00:00
Nikolai Kochetov
61a484f0bd Batch fix for projections analysis with analyzer. 2023-04-03 16:44:31 +00:00
Yakov Olkhovskiy
e3457da144 for auto check subset of columns support, fix some minor issues 2023-04-03 16:05:21 +00:00
Antonio Andelic
f21c664744 Add error code 2023-04-03 15:17:06 +00:00
Antonio Andelic
f5e97fbb66 Merge branch 'master' into alternative-keeper-configs 2023-04-03 15:06:52 +00:00
Antonio Andelic
e81c2999a3
Update src/Interpreters/InterpreterAlterQuery.cpp
Co-authored-by: Alexander Tokmakov <tavplubix@clickhouse.com>
2023-04-03 16:56:45 +02:00
Antonio Andelic
12bee0573f Correctly check table 2023-04-03 14:54:14 +00:00
Antonio Andelic
eacc3752bf Merge branch 'master' into dont-replicate-mutations-keepermap 2023-04-03 14:38:57 +00:00
Antonio Andelic
950a7d9948 Merge branch 'master' into keeper-map-strict-mode 2023-04-03 14:26:14 +00:00
Antonio Andelic
e7d00c8f34 Don't replicate mutations for KeeperMap tables 2023-04-03 14:22:08 +00:00
Nikolai Kochetov
d4b91b7f8c
Merge pull request #47319 from ClickHouse/query-plan-update-sort-description
Query plan: update sort description
2023-04-03 15:42:49 +02:00
Robert Schulze
a50e741bea
Merge pull request #45912 from ClickHouse/qc-compression
Query cache: Enable compression of cache entries
2023-04-03 13:33:47 +02:00
Robert Schulze
3e124f09d0
Merge remote-tracking branch 'origin/master' into qc-compression 2023-04-03 11:28:17 +00:00
Antonio Andelic
2d89057142 Merge branch 'master' into keeper-map-strict-mode 2023-04-03 09:30:52 +00:00
Raúl Marín
8fdf87982c Merge remote-tracking branch 'blessed/master' into zk_retry_timeout 2023-04-03 10:26:18 +02:00
Alexey Milovidov
5ebf66819b
Merge pull request #47617 from ClickHouse/cnf-new-analyzer
CNF/Constraint optimizer in new analyzer
2023-04-02 20:09:34 +03:00
Alexey Milovidov
15a62df60c
Merge pull request #48054 from ClickHouse/custom-key-new-analyzer
Make custom key for parallel replicas work in new analyzer
2023-04-02 20:09:00 +03:00
Alexey Milovidov
9c6594a043
Merge pull request #48320 from azat/explain-fix
Fix crash in EXPLAIN PIPELINE for Merge over Distributed
2023-04-02 17:11:27 +03:00
Azat Khuzhin
907ed27ae2 Fix crash in EXPLAIN PIPELINE for Merge over Distributed
CI: https://s3.amazonaws.com/clickhouse-test-reports/48314/179450542879d11711cd2415c3fa7eeab18188be/fuzzer_astfuzzerasan/report.html
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2023-04-02 10:48:23 +02:00
kssenii
54df42136b Rewrite space reservation so that at most one key lock is taken at a time 2023-04-01 17:53:03 +02:00
Azat Khuzhin
c64f9e6f07 Use StrongTypedef for ProfileEvents
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2023-04-01 16:01:33 +02:00
Azat Khuzhin
8d0e516310 Use StrongTypedef for CurrentMetrics to avoid possible incorrect usage
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2023-04-01 16:01:33 +02:00
Azat Khuzhin
3ede50ccfc Fix MaxPushedDDLEntryID 2023-04-01 16:00:03 +02:00
Alexander Tokmakov
48b23dd012
Fix race between DROP MatView and RESTART REPLICAS (#47863)
* fix race between drop mv and restart replicas

* unrelated: fix bad exception messages

* fix test

* fix

* fix

* fix

* fix

* fix test

* fix

* fix test

* Update 02437_drop_mv_restart_replicas.sh

* fix tests
2023-04-01 15:26:00 +03:00
Alexander Gololobov
bf02068702
Merge pull request #48303 from ClickHouse/grouping-sets-repeated-keys
Do not remove inputs from maybe compiled DAG.
2023-04-01 11:39:34 +02:00
Yakov Olkhovskiy
2f280e247a review suggestions 2023-03-31 21:37:18 +00:00
Alexander Tokmakov
9df882c37a
Merge pull request #48085 from ClickHouse/sync_replica_lightweight
More options for `SYSTEM SYNC REPLICA`
2023-03-31 23:18:31 +03:00
Nikolai Kochetov
1693e46640 Do not remove inputs from maybe compiled DAG. 2023-03-31 19:03:20 +00:00
Alexander Tokmakov
9552b37414
Merge pull request #48267 from ClickHouse/fix_some_tests2
Fix some tests
2023-03-31 22:03:00 +03:00
Robert Schulze
1e347e626c
Merge pull request #48241 from ClickHouse/rs/sort-show-processlist
Sort output of SHOW PROCESSLIST
2023-03-31 18:09:11 +02:00
Alexander Tokmakov
e39498129c
Merge branch 'master' into sync_replica_lightweight 2023-03-31 18:17:08 +03:00
Antonio Andelic
1e3abc9e84 Add strict mode for KeeperMap 2023-03-31 14:24:32 +00:00
Robert Schulze
5d64841276
Merge pull request #48017 from ClickHouse/rs/show_columns
MySQL compatibility: Implement `SHOW COLUMNS`
2023-03-31 15:50:23 +02:00
Alexander Tokmakov
caf00b5968 Merge branch 'master' into sync_replica_lightweight 2023-03-31 14:52:55 +02:00
Alexander Tokmakov
f54fd15112 fix 2023-03-31 12:58:11 +02:00
Robert Schulze
8d91a9f4c2
Sort descendingly by elapsed time 2023-03-31 09:36:03 +00:00
Alexander Tokmakov
64b1f74a60 fix 2023-03-31 01:39:49 +02:00
pufit
dacdbe469e GRANT CURRENT GRANTS implementation 2023-03-30 18:15:08 -04:00
Alexander Tokmakov
d12bab3ce1 add zk retries for distributed ddl 2023-03-30 20:47:25 +02:00
Azat Khuzhin
edeeac84cf Fix incorrect ThreadPool usage after ThreadPool introspection
```
$ gg 'ThreadPool[^()]([A-Za-z_]\+,' src/
src/Interpreters/Context.cpp:        shared->load_marks_threadpool = std::make_unique<ThreadPool>(pool_size, pool_size, queue_size);
src/Interpreters/Context.cpp:        shared->prefetch_threadpool = std::make_unique<ThreadPool>(pool_size, pool_size, queue_size);
src/Interpreters/Context.cpp:        shared->threadpool_writer = std::make_unique<ThreadPool>(pool_size, pool_size, queue_size);
```

Fixes: #47880
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2023-03-30 20:08:38 +02:00
Robert Schulze
191f780223
Sort output of SHOW PROCESSLIST
Follow-up to #48127
2023-03-30 17:22:20 +00:00
Yakov Olkhovskiy
2ca77b13fe
Merge branch 'master' into imp-use-structure-from-insertion 2023-03-30 12:23:12 -04:00
Mikhail f. Shiryaev
9593ffc7cb
Determine the hosts order in SHOW CLUSTER query 2023-03-30 17:37:31 +02:00
kssenii
e2cbccfbc4 Merge remote-tracking branch 'upstream/master' into cache-better-locks 2023-03-30 17:33:46 +02:00
filimonov
fbb22348ea
Refactor reading the pool setting & from server config. (#48055)
After #36425 there was a lot of confusions/problems with configuring pools - when the message was confusing, and settings need to be ajusted in several places.
See some examples in #44251, #43351, #47900, #46515.

The commit includes the following changes:
1) Introduced a unified mechanism for reading pool sizes from the configuration file(s). Previously, pool sizes were read from the Context.cpp with fallbacks to profiles, whereas main_config_reloader in Server.cpp read them directly without fallbacks.
2) Corrected the data type for background_merges_mutations_concurrency_ratio. It should be float instead of int.
3) Refactored the default values for settings. Previously, they were defined in multiple places throughout the codebase, but they are now defined in one place (or two, to be exact: Settings.h and ServerSettings.h).
4) Improved documentation, including the correct message in system.settings.

Additionally make the code more conform with #46550.
2023-03-30 16:44:11 +02:00
Alexander Tokmakov
131395b00f
Merge pull request #48171 from aalexfvk/add_option_disable_on_cluster_queries
Add allow_distributed_ddl_queries option to the cluster config
2023-03-30 17:29:02 +03:00
kssenii
d94d08c18d Fix tests 2023-03-30 15:58:12 +02:00
Yakov Olkhovskiy
79a8bf7375
Merge branch 'master' into imp-use-structure-from-insertion 2023-03-30 09:12:10 -04:00
Nikolai Kochetov
b3d77c0c30
Merge pull request #48177 from ClickHouse/deprecate-explain-query-tree-with-disabled-analyzer
Deprecate EXPLAIN QUERY TREE with disabled analyzer.
2023-03-30 13:56:40 +02:00
Robert Schulze
b0473098c6
Merge branch 'master' into qc-compression 2023-03-30 10:55:42 +02:00
Robert Schulze
47fd1ee06d
Merge pull request #48127 from ClickHouse/rs/sort-show
Sort output of SHOW <INFO> statements
2023-03-30 10:54:23 +02:00
Nikolay Degterinsky
870ee4b4f5
Merge pull request #47813 from FrankChen021/query_id
Add `X-ClickHouse-Query-Id` to HTTP response when queries fail to execute
2023-03-30 09:00:03 +02:00
Alexey Milovidov
e982fb9f1c
Merge pull request #47880 from azat/threadpool-introspection
ThreadPool metrics introspection
2023-03-30 01:27:31 +03:00
kssenii
245d04bb84 Fix changes from commit ba582dd, refactor a bit 2023-03-30 00:01:56 +02:00
Aleksei Filatov
0ac9dcd723 Add allow_distributed_ddl_queries option to the cluster config 2023-03-29 18:15:46 +03:00
Nikolai Kochetov
85795965c0 Deprecate EXPLAIN QUERY TREE with disabled analyzer. 2023-03-29 14:59:01 +00:00
Alexey Milovidov
cc345853e7
Merge pull request #47594 from ClickHouse/decimal256-various
Add specializations for Decimal256 in various places
2023-03-29 17:33:20 +03:00
Alexander Tokmakov
c5b6ed410d
Merge pull request #48130 from ClickHouse/support_undrop_table
Merging "Support undrop table"
2023-03-29 16:49:58 +03:00
kssenii
ba582dd74c Move assertions to a better place 2023-03-29 15:31:25 +02:00
Robert Schulze
b324d0ed5e
Merge branch 'master' into qc-compression 2023-03-29 15:09:22 +02:00
kssenii
4cf2862a0e Merge remote-tracking branch 'upstream/master' into cache-better-locks 2023-03-29 12:50:36 +02:00
Robert Schulze
d0f4c63d27
Fix tests 2023-03-29 10:30:40 +00:00
Azat Khuzhin
f38a7aeabe ThreadPool metrics introspection
There are lots of thread pools and simple local-vs-global is not enough
already, it is good to know which one in particular uses threads.

Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2023-03-29 10:46:59 +02:00
save-my-heart
167757746f
Merge branch 'master' into throw_non_parametric_function 2023-03-29 16:15:11 +08:00
Yakov Olkhovskiy
211fa2117c clang wants it 2023-03-29 03:50:21 +00:00
Alexander Tokmakov
cfe0fb6571 fix 2023-03-29 03:31:39 +02:00
Alexander Tokmakov
53725bdea1 monor improvements 2023-03-28 23:47:45 +02:00
Robert Schulze
6f8a450805
Sort output of SHOW <INFO> statements
Sorting is strictly speaking not necessary, but
1. sorted output is more user-friendly,
2. SQL currently does not allow to sort the output of SHOW <INFO>
   otherwise, e.g. SELECT * FROM (SHOW <INFO> ...) ORDER BY is rejected.
3. SQL tests can take advantage of that.
2023-03-28 20:55:59 +00:00
Alexander Tokmakov
614f8b313e
Merge pull request #47856 from Algunenano/zk_inject_timeout
Allow injecting timeout errors on Keeper
2023-03-28 23:40:51 +03:00
kssenii
c9ba1e7a71 Move checks 2023-03-28 22:14:45 +02:00
Robert Schulze
6c84eabb79
Fix stylecheck 2023-03-28 20:07:26 +00:00
Robert Schulze
e743f840f0
Fix taipos 2023-03-28 20:05:17 +00:00
Alexander Tokmakov
a1076005c7 Merge branch 'master' into support_undrop_table 2023-03-28 22:03:31 +02:00
Robert Schulze
202f52dc3a
Implement SHOW COLUMNS
Modeled after (*)

Fixes #46437

(*) https://dev.mysql.com/doc/refman/8.0/en/show-columns.html
2023-03-28 18:04:22 +00:00
Yakov Olkhovskiy
a03bf8568a implement use_structure_from_insertion_table_in_table_functions=auto 2023-03-28 17:03:35 +00:00
save-my-heart
cea631a4c2 throw exception while non-parametric functions having parameters 2023-03-28 23:24:07 +08:00
Sema Checherinda
b774310dc9 keep query id for logging when optimize query 2023-03-28 16:44:47 +02:00
Igor Nikonov
259df04415 Merge remote-tracking branch 'origin/master' into decimal256-various 2023-03-28 13:36:53 +00:00
kssenii
b541ec485d Fix 2023-03-28 11:55:55 +02:00
Kseniia Sumarokova
62c6aea45b
Merge pull request #47975 from MikhailBurdukov/mburdukov_ignore_inacc_tables
Skip materialized view checking if source table does not exist
2023-03-28 11:29:11 +02:00
SmitaRKulkarni
98999c2afb
Merge pull request #48065 from ClickHouse/Support_parameterized_view_with_cte
Support for cte in parameterized views
2023-03-28 11:18:16 +02:00
Antonio Andelic
0b5fd2140a Merge branch 'master' into cnf-new-analyzer 2023-03-28 07:57:12 +00:00
Antonio Andelic
d2c1d16e29 Merge branch 'master' into custom-key-new-analyzer 2023-03-28 07:24:29 +00:00
Antonio Andelic
4aa8c5fe49 Merge branch 'master' into alternative-keeper-configs 2023-03-28 07:23:24 +00:00
Alexander Tokmakov
b5fe1ada0b more options for sync replica 2023-03-28 01:39:36 +02:00
xiedeyantu
62087c3f09 fix 2023-03-28 07:27:13 +08:00
Alexey Milovidov
5d0e34d2a7
Merge pull request #47953 from ClickHouse/Avogar-patch-2
Fix tsan error lock-order-inversion
2023-03-28 01:10:50 +03:00
MikhailBurdukov
c296c2e299 Review changes 2023-03-27 18:34:12 +00:00
Raúl Marín
ff209db129
Merge branch 'master' into zk_inject_timeout 2023-03-27 19:46:10 +02:00
kssenii
667905f645 Fix duplicate include 2023-03-27 19:24:46 +02:00
kssenii
daa3d913c0 Fix 2023-03-27 19:06:49 +02:00
xiedeyantu
9382c6ffdc better 2023-03-27 23:51:35 +08:00
Smita Kulkarni
cb04c6301c Support for cte in parameterized views
Implementation:
* Updated to allow query parameters while evaluating scalar subqueries.
Testing:
* Added test case with cute for parameterized view.
2023-03-27 16:30:53 +02:00
Sema Checherinda
a6ab33a906 no use query, but storage context 2023-03-27 16:30:32 +02:00
xiedeyantu
5036d19af3 better 2023-03-27 22:16:37 +08:00
xiedeyantu
5a18e0d5a5 support undrop table 2023-03-27 22:16:36 +08:00
Antonio Andelic
fa8ea85f3d Make custom key work with new analyzer 2023-03-27 13:39:33 +00:00
avogar
64db4c478b Use one map 2023-03-27 13:19:45 +00:00
Raúl Marín
714b54b322 Reimplement enable_fault_injections_during_startup 2023-03-27 15:06:46 +02:00
kssenii
569a1508eb Fix 2023-03-27 14:05:12 +02:00
Nikolay Degterinsky
227425968f
Merge branch 'master' into query_id 2023-03-27 13:41:42 +02:00
Antonio Andelic
86b40a1b79 address PR review 2023-03-27 10:03:40 +00:00
Antonio Andelic
93f5920e02
Merge branch 'master' into alternative-keeper-configs 2023-03-27 10:00:21 +02:00
Antonio Andelic
e4a78a982f Merge branch 'master' into cnf-new-analyzer 2023-03-27 07:43:21 +00:00
Alexey Milovidov
b6892f53fc
Merge pull request #47724 from ClickHouse/rs/qc-better-cfg-name
Rename cfg parameter query_cache.size to query_cache.max_size
2023-03-27 00:36:24 +03:00
kssenii
b808c35480 Fix style check 2023-03-26 23:17:04 +02:00
kssenii
f5fa43b79b Remove redundant 2023-03-26 22:33:59 +02:00
kssenii
1adef76cbd Better comment 2023-03-26 22:10:14 +02:00
kssenii
e6e71dc832 Do not take KeyGuard::Lock under CacheMetadataGuard::Lock to make metadata lock truly lightweight 2023-03-26 22:02:51 +02:00
kssenii
88f631b297 Review fixes, perform delayed removal in background 2023-03-26 16:53:33 +02:00
kssenii
85160f7265 Slightly less pressure on debug server 2023-03-25 22:22:01 +01:00
kssenii
9531aa0b79 Better 2023-03-25 18:25:10 +01:00
kssenii
b8e958df07 Review fix 2023-03-25 18:10:14 +01:00
kssenii
b167edc1e6 Fix data race because of incorrect destruction order 2023-03-25 18:05:11 +01:00
Nikolai Kochetov
327674f56d
Merge pull request #46537 from ClickHouse/aggregate-projections-analysis-query-plan
Projections analysis from query plan
2023-03-25 13:23:30 +01:00
Yakov Olkhovskiy
07502600f7 clang wants it :\ 2023-03-25 05:15:10 +00:00
Yakov Olkhovskiy
a4e2d09001 without schema inference from actual data 2023-03-24 21:58:23 +00:00
Yakov Olkhovskiy
1108a299a6
Merge branch 'master' into imp-use-structure-from-insertion 2023-03-24 16:36:12 -04:00
kssenii
47d91b63ae Fix 2023-03-24 20:34:42 +01:00
avogar
d00587202d Make better 2023-03-24 19:25:07 +00:00
Maksim Kita
5cb2d30563
Merge pull request #47316 from ClickHouse/vdimir/transform_external_query_analyzer
Support transformQueryForExternalDatabase for analyzer
2023-03-24 17:53:00 +01:00
kssenii
9dc9f67f93 Get rid of metadata references 2023-03-24 17:18:41 +01:00
avogar
ee0fd39f2a Fix data-race 2023-03-24 15:20:19 +00:00
Nikolai Kochetov
a2182f2659
Merge pull request #47874 from amosbird/correct_exact_rows_before_limit
Correct `exact_rows_before_limit` in some scenarios
2023-03-24 15:09:42 +01:00
kssenii
0d89be20b0 Review fixes 2023-03-24 14:45:03 +01:00
Robert Schulze
0712627c05
Query cache: Fix config naming ambiguity
Add 'max_' prefix to 'size' setting to make it more clear that the cache
consumes no space if not used.
2023-03-24 12:52:09 +00:00
Kruglov Pavel
97592cfdfd
Merge branch 'master' into Avogar-patch-2 2023-03-24 13:44:28 +01:00
MikhailBurdukov
cc92eacb3e Merged several tests into one and rm unnecessary func 2023-03-24 11:51:09 +00:00
MikhailBurdukov
68118388e6 Rename opt key, added test and refactored code. 2023-03-24 08:23:22 +00:00
Dmitry Novik
3488a4d84b Improve file includes 2023-03-24 03:44:52 +01:00
Yakov Olkhovskiy
3e50ccdb45 fixed bug with names mapping, better structure propagation 2023-03-24 00:27:04 +00:00
Nikolai Kochetov
73e98de46d Merge branch 'master' into aggregate-projections-analysis-query-plan 2023-03-23 21:28:36 +01:00
Maksim Kita
24b9e5103f
Merge pull request #47748 from ClickHouse/revert-47721-revert-47622-analyzer-planner-fixes-before-enable-by-default
Revert "Revert "Analyzer planner fixes before enable by default""
2023-03-23 22:20:34 +03:00
Kruglov Pavel
9003b7d789
Fix tsan error lock-order-inversion 2023-03-23 20:14:32 +01:00
vdimir
c2a3679959
Add buildSelectQueryInfo to Planner/Utils, use in unit tests 2023-03-23 15:53:22 +00:00
Antonio Andelic
d6cbc5d05b Fix tests 2023-03-23 15:01:51 +00:00
Azat Khuzhin
2b439f079e
Make backup_threads/restore_threads server settings (#47881)
Those settings can be applied only at start, so it is better to have
them in configuration file instead of user profile settings.

Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2023-03-23 15:44:15 +01:00
kssenii
fcd535124a Better 2023-03-23 14:00:14 +01:00
kssenii
3f1d0fa14c Simplify cache loading 2023-03-23 13:46:38 +01:00
kssenii
6dc08b2768 Review fixes 2023-03-23 13:02:16 +01:00
kssenii
b4837af20f Fix race 2023-03-23 12:21:58 +01:00
Antonio Andelic
a4d1cd514d Refactor 2023-03-23 08:58:56 +00:00
MikhailBurdukov
62c8eeb25c Ignoring inaccessible tables for attaching to the materilized view 2023-03-22 20:13:30 +00:00
vdimir
426f4ec233
Better transformQueryForExternalDatabase for analyzer 2023-03-22 16:58:34 +00:00
kssenii
5ee5e2c339 Remove fixme 2023-03-22 17:37:49 +01:00
kssenii
5b7f214ea9 Better names for some methods 2023-03-22 17:34:29 +01:00
Maksim Kita
f45dac99c2 Revert "Revert "Analyzer planner fixes before enable by default"" 2023-03-22 17:19:32 +01:00
kssenii
9b9cf13607 Add comment 2023-03-22 17:01:31 +01:00
kssenii
876fb55156 Remove redundant code 2023-03-22 16:51:30 +01:00
kssenii
c35deb8094 Review fixes 2023-03-22 16:49:33 +01:00
Amos Bird
02c5d1f364
Correct exact_rows_before_limit in all senarios 2023-03-22 23:26:31 +08:00
kssenii
419d9a4887 Fix typo from previous commit 2023-03-22 15:11:14 +01:00
Antonio Andelic
65b99ec6a7 Merge branch 'master' into alternative-keeper-configs 2023-03-22 12:22:57 +00:00
Frank Chen
532590773a Fix typo check 2023-03-22 17:46:09 +08:00
Frank Chen
c1927d8f3e Fix check style 2023-03-22 16:39:14 +08:00
Maksim Kita
4dc5a629c3
Merge pull request #47758 from ClickHouse/vdimir/comparsion_tuple_elimination_ast
Add ComparisonTupleEliminationVisitor
2023-03-22 11:22:25 +03:00
SmitaRKulkarni
464b166e91
Merge pull request #47725 from ClickHouse/46741_Parameterized_view_support_subquery
Support for subquery in parameterized views
2023-03-22 09:05:26 +01:00
vdimir
023d14a894 Support transformQueryForExternalDatabase for analyzer 2023-03-22 08:59:04 +01:00
Frank Chen
3e05f2c58a Improve comment 2023-03-22 14:35:58 +08:00
Frank Chen
3de73d03cc Improve the robustness 2023-03-22 14:31:16 +08:00
kssenii
da05e63f2e Simplify code 2023-03-21 23:14:25 +01:00
kssenii
2376f3a298 Review fixes 2023-03-21 22:50:16 +01:00
Alexander Tokmakov
0989dd837a
Merge pull request #47802 from ClickHouse/fix_some_tests
Fix 993 and two other tests
2023-03-21 22:20:06 +03:00
Smita Kulkarni
aa079efbb7 Addressed review comments 2023-03-21 18:29:26 +01:00
Igor Nikonov
d72c0def6e Improve search of original node name in ActionsDAG 2023-03-21 16:30:13 +00:00
vdimir
c25170381c
Better ComparisonTupleEliminationVisitor 2023-03-21 16:23:09 +00:00
vdimir
030ee3a525
Add ComparisonTupleEliminationVisitor 2023-03-21 16:11:06 +00:00
Alexander Tokmakov
9c4c7948e5
Update src/Interpreters/Session.cpp
Co-authored-by: alesapin <alesapin@clickhouse.com>
2023-03-21 17:39:45 +03:00
Alexander Tokmakov
be4884d07a
Update src/Interpreters/Session.cpp
Co-authored-by: alesapin <alesapin@clickhouse.com>
2023-03-21 17:39:40 +03:00
Igor Nikonov
5e1c645483 Merge remote-tracking branch 'origin/master' into query-plan-update-sort-description 2023-03-21 14:25:07 +00:00
Alexander Tokmakov
17e1c6be8e fix race condition on session close 2023-03-21 15:01:39 +01:00
Kseniia Sumarokova
a9bcd022d5
Merge pull request #46241 from kssenii/named-collections-granular-access
Allow separate grants for every named collection
2023-03-21 12:27:53 +01:00
Vladimir C
ab1105a5a6
Merge pull request #47685 from ClickHouse/vdimir/issue_47533 2023-03-21 11:41:00 +01:00
Frank Chen
837638e1c1 Fix style 2023-03-21 15:27:13 +08:00
Frank Chen
91a34fa627 Set query id in case of exceptions during query execution 2023-03-21 14:10:01 +08:00
Robert Schulze
595796e63d
Merge branch 'master' into rs/more-llvm-16-preparation 2023-03-20 21:16:27 +01:00
Robert Schulze
d8493780b2
Query cache: Enable compression and squashing of result blocks
ClickHouse reads table data in blocks of 'max_block_size' rows. Due to
filtering, aggregation, etc., result blocks are typically much smaller
than 'max_block_size' but there are also cases where they are much
bigger. Setting 'query_cache_squash_partial_results' (enabled by
default) now controls if result blocks are squashed (if they are tiny)
or split (if they are large) into blocks of 'max_block_size' size before
insertion into the query result cache. This reduces performance of
writes into the query cache but improves compressability of cache
entries and provides more natural block granularity when query results
are later served from the query cache.

Entries in the query cache are now also compressed by default. This
reduces the overall memory consumption at the cost of slower writes into
/ reads from the query cache. To disable compression, use setting
'query_cache_compress_entries'.
2023-03-20 20:11:41 +00:00
Robert Schulze
82a4b307ae
Merge branch 'master' into rs/qc-cachebase 2023-03-20 20:44:34 +01:00
Anton Popov
158131053b
Merge pull request #47688 from ucasfl/fix-limit-offset
Fix limit offset
2023-03-20 18:47:41 +01:00
Robert Schulze
3b7f929001
Merge branch 'master' into rs/qc-cachebase 2023-03-20 17:08:47 +01:00
kssenii
75624c52f7 Merge remote-tracking branch 'upstream/master' into named-collections-granular-access 2023-03-20 16:38:14 +01:00
vdimir
19fb88c2c1
Simple fix logical error in evaluate constant expression 2023-03-20 15:10:50 +00:00
Robert Schulze
5b036a1a3b
More preparation for libcxx(abi), llvm, clang-tidy 16 (follow-up to #47722) 2023-03-20 12:55:03 +00:00
vdimir
9b8d20e443
Revert better fix logical error in evaluate constant expression 2023-03-20 12:42:09 +00:00
vdimir
a78b817e6f
Fix logical error in evaluate constant expression 2023-03-20 12:35:54 +00:00
kssenii
019de827a1 Fix 2023-03-20 13:23:24 +01:00
Alexey Milovidov
4a44dafdee Merge branch 'master' into decimal256-various 2023-03-20 03:30:14 +01:00
Alexey Milovidov
ddf29b69f9
Merge branch 'master' into fuzzer-of-data-formats 2023-03-20 03:26:51 +03:00
Alexey Milovidov
e788bf0712
Merge pull request #47721 from ClickHouse/revert-47622-analyzer-planner-fixes-before-enable-by-default
Revert "Analyzer planner fixes before enable by default"
2023-03-20 03:24:03 +03:00
Smita Kulkarni
87cb2e1629 Support for subquery in parameterized views
Implementation:
* Updated to pass the parameter is_create_parameterized_view to subquery processing.
Testing:
* Added test case with subquery for parameterized view.
2023-03-19 19:41:19 +01:00
Robert Schulze
0e01e912fe
Preparation for libcxx(abi), llvm, clang-tidy 16 2023-03-19 17:25:41 +00:00
Alexey Milovidov
ef5e8462da
Revert "Analyzer planner fixes before enable by default" 2023-03-19 19:25:37 +03:00
Alexey Milovidov
7f54aab145 Merge branch 'master' of github.com:ClickHouse/ClickHouse into fuzzer-of-data-formats 2023-03-19 16:57:35 +01:00
Robert Schulze
c4664c70a1
Merge branch 'master' into rs/qc-cachebase 2023-03-19 15:23:24 +01:00
Alexey Milovidov
3655667188 Make the code in Join less disgusting 2023-03-19 07:35:56 +01:00
Alexey Milovidov
0ec04cca5e Make the code in Join less disgusting 2023-03-19 07:32:29 +01:00
Alexey Milovidov
8fdbc5409c Make the code in Join less disgusting 2023-03-19 07:31:18 +01:00
Alexey Milovidov
100089a76c Make the code in Join less disgusting 2023-03-19 07:17:59 +01:00
Alexey Milovidov
2a077f11f6 Merge branch 'master' into fuzzer-of-data-formats 2023-03-19 01:07:31 +01:00
Ongkong
d9c7bc1859
Fix ASOF LEFT JOIN performance degradation (#47544) 2023-03-18 23:53:00 +01:00
Alexey Milovidov
b97154263d
Merge pull request #47703 from ClickHouse/add-style-check-for-dereference-after-cast
Add a style check for unsafe code
2023-03-18 22:07:47 +03:00
Alexander Tokmakov
f1df91cd09
Merge pull request #47659 from ClickHouse/fix_993
Fixes for 993 and friends
2023-03-18 14:46:43 +03:00
Maksim Kita
5187138510
Merge pull request #47622 from kitaisreal/analyzer-planner-fixes-before-enable-by-default
Analyzer planner fixes before enable by default
2023-03-18 13:11:40 +03:00
Alexey Milovidov
aea421cc9b Add a style check for unsafe code 2023-03-18 03:29:14 +01:00
Sema Checherinda
0b641fcead
Merge pull request #47564 from CheSema/remove-redundant
remove counters for threads, fix negative counters
2023-03-18 02:23:52 +01:00
Alexey Milovidov
26d17fe560 Merge branch 'master' of github.com:ClickHouse/ClickHouse into decimal256-various 2023-03-17 22:15:16 +01:00
Alexey Milovidov
c11915d35b Merge branch 'fix-bson-2' of github.com:Avogar/ClickHouse into fuzzer-of-data-formats 2023-03-17 22:05:46 +01:00
vdimir
68da4f713e
Real better fix logical error in evaluate constant expression 2023-03-17 18:38:47 +00:00
Alexander Tokmakov
d11aee2b0c
Merge branch 'master' into fix_993 2023-03-17 21:28:23 +03:00