Commit Graph

39998 Commits

Author SHA1 Message Date
serxa
ce2073e58f detach_thread() and notifications order does not matter 2023-04-13 11:45:19 +00:00
kssenii
3ac7f999bc Review fixes 2023-04-13 13:38:16 +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
serxa
5e8339c2d9 Lock ThreadPool mutex once per job instead of twice 2023-04-13 11:27:11 +00:00
Vitaly Baranov
6b71cb1c35 Fix zero-copy-replication on encrypted disks. 2023-04-13 13:15:18 +02:00
Robert Schulze
3e3344d627
VarInt coding: Always perform sanity check
This is follow-up for the discussion in #48628. The sanity check against
VAR_UINT_MAX is now unconditional (independent of the build type). Let's
see how that affects performance ... I'll probably add "Unchecked"
overloads later on (to avoid clutter they are avoided for now)
2023-04-13 09:44:35 +00:00
Robert Schulze
658d6c8870
Merge pull request #48567 from FriendLey/test_soundex
add soundex function, issue #39880
2023-04-13 11:20:19 +02:00
Kseniia Sumarokova
b6c17759f4
Merge pull request #48636 from kssenii/fix-error-in-cache
Fix possible error from cache
2023-04-13 11:03:11 +02:00
Robert Schulze
f6b24fe058
Merge pull request #48509 from ClibMouse/feature/no-more-strlen-plz
Use std::string_view to get rid of strlen
2023-04-13 10:59:05 +02:00
Robert Schulze
7a21d5888c
Remove -Wshadow suppression which leaked into global namespace 2023-04-13 08:46:40 +00:00
Robert Schulze
22c3b10e41
Merge pull request #48628 from ClickHouse/rs/var_uint_max
Better handling of values too large for VarInt encoding
2023-04-13 10:17:55 +02:00
Robert Schulze
f41354ccd6
Merge pull request #48671 from ClickHouse/rs/gcc-removal
Remove GCC remainders
2023-04-13 10:15:35 +02:00
Sergei Trifonov
86d37916a0
Merge pull request #48146 from azat/threadpool-pipeline-executor
Use ThreadPool in PipelineExecutor
2023-04-13 09:45:15 +02:00
FriendLey
50af10771e
Merge branch 'master' into test_soundex 2023-04-13 10:17:08 +08:00
Robert Schulze
700492f6d4
Fixes and refactorings for consistency with the remaining codebase 2023-04-12 22:41:26 +00:00
Alexander Tokmakov
75f18b1198
Revert "Check simple dictionary key is native unsigned integer" 2023-04-13 01:32:19 +03:00
Alexander Tokmakov
5d77bb149e do not remove broken detached parts on startup 2023-04-12 23:26:34 +02:00
Anton Popov
05a93ef123 add flush id and time for async insert with empty data 2023-04-12 20:57:55 +00:00
Robert Schulze
3f7ce60e03
Merge branch 'master' into rs/gcc-removal 2023-04-12 22:17:04 +02:00
robot-ch-test-poll2
d1793a9bc5
Merge pull request #48692 from ClickHouse/rs/mergetree-syntax
Update MergeTree syntax for optional index granularity argument
2023-04-12 21:35:40 +02:00
Igor Nikonov
e3b61a4ea7 Fix memory order in number_mt 2023-04-12 19:35:12 +00:00
ltrk2
c3f5da3343 Remove element that used to serve as a sentinel 2023-04-12 12:15:53 -07: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
Alexander Tokmakov
69790b76b2 fix the same issue in other functions 2023-04-12 20:36:23 +02:00
ltrk2
65e08781a6 Use std::string_view to get rid of strlen 2023-04-12 11:33:11 -07:00
Azat Khuzhin
37d430d68a Use ThreadPool in PipelineExecutor
PipelineExecutor is one of the heavy user of the threads, by using pool
there number of used threads for query execution can be tracked in
system.metrics.

Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2023-04-12 20:00:51 +02:00
alesapin
8067cfcb51
Merge pull request #46946 from ClickHouse/revert-46909-revert-45911-mutations_rename_hang
Fix several `RENAME COLUMN` bugs
2023-04-12 19:07:48 +02:00
Alexander Tokmakov
71258202bb Merge branch 'master' into 16414-totimezone-throw 2023-04-12 17:58:48 +02:00
Kseniia Sumarokova
17bb707752
Merge branch 'master' into fix-error-in-cache 2023-04-12 17:40:15 +02:00
Dmitry Novik
6c11acccc9 Remove unnecessary code 2023-04-12 14:08:09 +00:00
Anton Popov
08aa629e56
Merge branch 'master' into fix-memory-compressed-tables 2023-04-12 15:38:54 +02:00
Anton Popov
1520f3e924
Merge pull request #48335 from lzydmxy/check_sample_dict_key_is_correct
Check simple dictionary key is native unsigned integer
2023-04-12 14:27:39 +02:00
MikhailBurdukov
2cd3512a5d
ClickHouse startup error when loading a distributed table that depends on a dictionary (#48419)
* Test for start failure.

* Handling the dictionary as shard key.

* Added integration test and fixed style

* Revert extra test

* Fix style

* Fix style

* Refactoring

* Fix build

* style fix
2023-04-12 15:06:02 +03: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
Nikolay Degterinsky
ff20acf076
Merge pull request #48445 from evillique/array-functions-date-datetime-support
Add support for Date/DateTime datatypes to arrayMin/Max, arrayDifference functions
2023-04-12 13:27:17 +02:00
Robert Schulze
6b441b40dd
Update MergeTree syntax for optional index granularity argument
This is follow up to #45451.
2023-04-12 11:16:55 +00:00
FriendLey
63928c6df0
Merge branch 'master' into test_soundex 2023-04-12 19:06:05 +08:00
alesapin
8ebad126e2
Merge pull request #48516 from MikhailBurdukov/mburdukov_multi_settings
"changed" flag in system.settings is calculated incorrectly for settings with multiple values
2023-04-12 12:54:50 +02:00
Kruglov Pavel
aa57cdb5f3
Merge pull request #48670 from azat/fix-lock-order-inversion-for-remote
Remove lock for duplicated parts UUIDs (allow_experimental_query_deduplication=1)
2023-04-12 12:42:12 +02:00
Nikolai Kochetov
bc4755952b
Merge pull request #48405 from ClickHouse/analyzer-additional-filters
Support additional filters in new planner
2023-04-12 12:38:57 +02:00
alesapin
55c3f1ee29
Merge pull request #48666 from ClickHouse/remove_strange_code_from_mutation_task
Remove strange code from MutateTask
2023-04-12 12:38:43 +02:00
Igor Nikonov
943f9f541b Call IProcessor::onCancel() once 2023-04-12 10:04:31 +00: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
Robert Schulze
53d0f76762
Fix fasttest 2023-04-12 08:31:13 +00:00
SmitaRKulkarni
dd64eaed66
Merge pull request #47985 from Algunenano/zk_retry_timeout
Do not continue retrying to connect to ZK if the query is killed or over limits
2023-04-12 08:49:47 +02:00
flynn
ea9187511e Make Schema inference works for CREATE AS SELECT 2023-04-12 04:21:03 +00:00
taiyang-li
e29cce4db9 support map node for json extract 2023-04-12 10:18:07 +08:00
Dmitry Novik
235ad55bad
Merge branch 'master' into analyzer-additional-filters 2023-04-12 01:13:38 +02:00
alesapin
f91309d83d Fix drop in compact parts 2023-04-11 21:21:42 +02:00
Azat Khuzhin
1d9a785b9b Add missing includes (due to removing ThreadPool.h from PipelineExecutor.h)
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2023-04-11 20:45:46 +02:00
Robert Schulze
05606a8835
Clean up GCC warning pragmas 2023-04-11 18:21:08 +00:00
Azat Khuzhin
d7f8650372 Remove lock for duplicated parts UUIDs (allow_experimental_query_deduplication=1)
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>
2023-04-11 20:19:32 +02:00
alesapin
a72ee0b85e Merge remote-tracking branch 'origin/master' into revert-46909-revert-45911-mutations_rename_hang 2023-04-11 20:14:43 +02:00
Robert Schulze
dcfd843b2d
Merge pull request #48489 from ClickHouse/rs/date_time-alias
Register datediff and trim aliases in system.functions
2023-04-11 19:53:44 +02:00
alesapin
165edd332e Remove strange code from MutateTask 2023-04-11 18:31:53 +02:00
Robert Schulze
1477887259
Initial removal of logic under COMPILER_GCC 2023-04-11 16:27:32 +00:00
Dmitry Novik
52f3406bbb Fix CurrentMetrics::MergesMutationsMemoryTracking value 2023-04-11 16:10:59 +00:00
Sergei Trifonov
7c309a0134
Merge branch 'master' into mburdukov_multi_settings 2023-04-11 17:53:43 +02:00
Dmitry Novik
06e6794fc0 Merge remote-tracking branch 'origin/master' into background-memory-tracker 2023-04-11 15:29:35 +00:00
Alexander Tokmakov
1982e2e040
Merge pull request #48662 from hanfei1991/hanfei/refine-expmsg1
fix 02504_regexp_dictionary_table_source
2023-04-11 18:20:10 +03:00
Anton Popov
09c66c3879 fix async inserts with empty data 2023-04-11 15:13:46 +00:00
Han Fei
bf28be8837 fix 02504_regexp_dictionary_table_source 2023-04-11 17:07:44 +02:00
Mikhail f. Shiryaev
89e4509e68
Merge branch 'master' into fix-memory-compressed-tables 2023-04-11 16:38:51 +02:00
Anton Popov
3896375247 fix getting subcolumn from in-memory data 2023-04-11 14:26:31 +00:00
Dmitry Novik
0e417b1a6f Cleanup the code 2023-04-11 14:08:28 +00:00
Yakov Olkhovskiy
6232d17876
Merge pull request #48611 from ClickHouse/fix-ip4-uint-compare
Fix IPv4 comparable with UInt
2023-04-11 09:53:33 -04:00
Anton Popov
5b8db57fe8
Merge branch 'master' into retry-loading-of-parts 2023-04-11 15:51:40 +02:00
Robert Schulze
1fc5d92ae2
Merge pull request #48627 from ClickHouse/rs/formatdatetime-refactoring
Minor refactoring of formatDateTime()
2023-04-11 15:29:47 +02:00
Kseniia Sumarokova
10bb328d7d
Merge branch 'master' into fix-error-in-cache 2023-04-11 15:25:38 +02:00
Anton Popov
5a77a2aa4c
Merge branch 'master' into CurtizJ-patch-7 2023-04-11 15:06:07 +02:00
FriendLey
e327371297
Merge branch 'master' into test_soundex 2023-04-11 21:02:01 +08:00
Han Fei
7210b50551
Merge pull request #48632 from hanfei1991/hanfei/refine-expmsg
refine some messages of exception in regexp tree
2023-04-11 14:45:35 +02:00
Antonio Andelic
b30aff06d8
Merge pull request #48595 from aalexfvk/alexfvk/fix_create_not_auth_problem
Fix bug in Keeper when a node is not created with scheme `auth` in ACL sometimes.
2023-04-11 14:41:37 +02:00
Kruglov Pavel
c3482a104f
Merge pull request #48472 from ClickHouse/Avogar-patch-2
Avoid operation on uninitialised data in readDateTimeTextImpl
2023-04-11 14:30:26 +02:00
robot-ch-test-poll1
028ccfdc87
Merge pull request #48438 from evillique/add-trailing-commas
Allow trailing commas in expression list of SELECT query
2023-04-11 14:21:28 +02:00
Robert Schulze
e08b7c8a53
Merge pull request #48422 from ClickHouse/rs/better-f-in-formatdatetime
MySQL compat: Align behavior of %f in formatDateTime() with parseDateTime()
2023-04-11 14:12:16 +02:00
Robert Schulze
4e52dc672e
Merge pull request #48420 from ClickHouse/rs/f
MySQL compat: Implement %f in parseDateTime()
2023-04-11 14:12:02 +02:00
SmitaRKulkarni
e2010c0257
Merge branch 'master' into zk_retry_timeout 2023-04-11 14:05:52 +02:00
Han Fei
c857f767fa
Merge branch 'master' into hanfei/refine-expmsg 2023-04-11 14:03:27 +02:00
Robert Schulze
ba67626992
Add comment about used exception code 2023-04-11 11:59:04 +00:00
vdimir
30659c5b48
Fix build ThreadGroupPtr 2023-04-11 11:46:53 +00:00
Kseniia Sumarokova
f4aa62ebc8
Merge branch 'master' into fix-error-in-cache 2023-04-11 13:40:46 +02:00
Sema Checherinda
4b9eff7dab
Merge pull request #48638 from ClickHouse/vdimir/fix-build-48543
Fix build src/Interpreters/InterpreterInsertQuery.h
2023-04-11 13:27:51 +02:00
Han Fei
6c33180ac8
Merge branch 'master' into hanfei/refine-expmsg 2023-04-11 13:19:38 +02:00
FriendLey
8aa17dbffe remove return in void function. 2023-04-11 19:18:27 +08:00
vdimir
4605d71947
Fix build src/Interpreters/InterpreterInsertQuery.h 2023-04-11 11:17:02 +00:00
FriendLey
c527347736
Merge branch 'master' into test_soundex 2023-04-11 19:16:10 +08:00
Sergei Trifonov
ca6e253fa6
Merge pull request #48526 from ClickHouse/lost-part-count 2023-04-11 13:11:42 +02:00
FriendLey
48463f79fd
Merge branch 'master' into test_soundex 2023-04-11 19:00:51 +08:00
kssenii
6717eab355 Fix 2023-04-11 12:35:59 +02:00
Kruglov Pavel
a0d11fdf53
Merge pull request #48436 from Avogar/fix-generate-random
Generate valid Decimals and Bools in generateRandom function
2023-04-11 12:06:08 +02:00
FriendLey
ffa1a75fb5 Merge branch 'master' into test_soundex 2023-04-11 17:52:32 +08: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
Han Fei
363b97fab8 refine some messages of exception in regexp tree 2023-04-11 11:45:29 +02:00
Robert Schulze
bbbb55cd50
Better handling of values too large for VarInt encoding
PR #48154 introduced a sanity check in the form of a debug assertion
that the input values for VarInt encoding are not too big. Such values
should be exceptionally rare in practice but the AST fuzzer managed to
trigger the assertion regardless. The strategy to deal with such values
until now was to bypass the check by limiting the value to the maximum
allowed value (see #48412). Because a new AST Fuzzer failure appeared
(#48497) and there may be more failures in future, this PR changes the
sanity check from an assert to an exception.

Fixes: #48497
2023-04-11 07:47:33 +00:00
Aleksei Filatov
dd2364361c
Update src/Coordination/tests/gtest_coordination.cpp
Co-authored-by: Antonio Andelic <antonio2368@users.noreply.github.com>
2023-04-11 10:45:30 +03:00
Robert Schulze
4b61685c64
Minor refactoring of formatDateTime()
Don't explicitly specify literal length when the called functions can
compute it.
2023-04-11 07:43:24 +00:00
Robert Schulze
c3f976c58a
Move space check out of loop 2023-04-11 06:19:10 +00:00
Robert Schulze
b7d5df7aa1
Merge branch 'master' into rs/better-f-in-formatdatetime 2023-04-11 08:11:04 +02:00
FriendLey
910bd8a15f bugfix: fix access illegal address bugs. 2023-04-11 13:01:53 +08:00