Commit Graph

125203 Commits

Author SHA1 Message Date
pufit
34aecc0bf3 Adjusting num_streams by expected work in StorageS3 2023-09-19 23:05:48 -04:00
taiyang-li
d59db55b14 add uts about array join 2023-09-20 10:23:47 +08:00
lgbo-ustc
e9e5c7a09b update 2023-09-20 08:44:30 +08:00
robot-clickhouse
c7c4166a73
Merge pull request #54670 from ClickHouse/fix-parser-unit-tests
Fix parser unit tests
2023-09-20 02:24:27 +02:00
Yakov Olkhovskiy
e8cd429453 add error code INVALID_IDENTIFIER 2023-09-19 22:11:58 +00:00
Michael Kolupaev
c856ec4087 Prevent ParquetMetadata reading 40 MB from each file unnecessarily 2023-09-19 21:58:50 +00:00
Michael Kolupaev
7271cfd187 Prevent parquet schema inference reading the first 1 MB of the file unnecessarily 2023-09-19 21:58:12 +00:00
slvrtrn
636fc506aa Replace information_schema view columns aliases with uppercase 2023-09-19 23:42:40 +02:00
Michael Kolupaev
fa51399ede Make clickhouse-local logging (server_logs_file) prepend timestamps etc 2023-09-19 21:39:59 +00:00
Igor Nikonov
e28f4e819c
Merge branch 'master' into parallel-replicas-not-enough-replicas 2023-09-19 23:05:24 +02:00
Igor Nikonov
3b4ff5a3d0
Merge branch 'master' into pr-distributed-prefer-localhost-replica 2023-09-19 23:01:30 +02:00
Azat Khuzhin
630eddbbbc Disable forwarding signals by watchdog in systemd service
With default KillMode=control-group, systemd will send signals to all
processes in cgroup and this will lead to server will be terminated
forcefully due to double signal.

    2023.09.19 12:47:06.369090 [ 763 ] {} <Information> Application: Received termination signal (Terminated)
    2023.09.19 12:47:06.369141 [ 762 ] {} <Debug> Application: Received termination signal.
    2023.09.19 12:47:06.369215 [ 763 ] {} <Information> Application: Received termination signal (Terminated)
    2023.09.19 12:47:06.369225 [ 763 ] {} <Information> Application: This is the second termination signal. Immediately terminate.
    2023.09.19 12:47:06.400959 [ 761 ] {} <Information> Application: Child process exited normally with code 143.

Someone may naively think that, hey, I can change KillMode to
process/mixed, but this will not work either, because in this case
systemd cannot wait for the $MainPID (and main_pid_alien=true in
systemd's sources), because it is not a child of systemd, and this will
lead to double signal again:

    2023.09.19 16:24:19.694473 [ 3118 ] {} <Information> Application: Received termination signal (Terminated)
    2023.09.19 16:24:19.694894 [ 3118 ] {} <Information> Application: Received termination signal (Terminated)
    2023.09.19 16:24:19.695060 [ 3118 ] {} <Information> Application: This is the second termination signal. Immediately terminate.

And this is because it sends signal firstly on a normal termnation and
then when it cleans up left over processes:

    clickhouse-server.service: Found left-over process 3117 (clickhouse-serv) in control group while starting unit. Ignoring.

And yes, even though it prints "Ignoring" here (I guess it is related to
the fact that it can be ignored if the signal will not be handled)

Here is a proof of double signal by systemd:

    # pgrep clickhouse-serv | xargs strace  -e /kill -fp
    strace: Process 3117 attached with 469 threads
    [pid  3582] --- SIGTERM {si_signo=SIGTERM, si_code=SI_USER, si_pid=1, si_uid=0} ---
    [pid  3580] --- SIGCONT {si_signo=SIGCONT, si_code=SI_USER, si_pid=1, si_uid=0} ---
    [pid  3582] --- SIGCONT {si_signo=SIGCONT, si_code=SI_USER, si_pid=1, si_uid=0} ---
    [pid  3580] --- SIGTERM {si_signo=SIGTERM, si_code=SI_USER, si_pid=1, si_uid=0} ---
                                                                      ^^^
    [pid  3118] tgkill(3117, 3118, SIGTERM) = 0 # and this is a force termination

So yes, there is no other way except for disabling signal forwarding.

*Well, there is another way, but I guess it is will be unwelcome (even
though systemd can be configured in multiple ways right now, and there
is even systemd-oomd instead of clickhouse'es watchdog) - disable
watchdog completelly.*

Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2023-09-19 22:09:38 +02:00
Azat Khuzhin
5e90cd413b Add ability to disable forwarding signals to the child by watchdog
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2023-09-19 22:09:38 +02:00
Azat Khuzhin
4c30156595 Disable killing the server by systemd (that may lead to data loss for Buffer)
Default systemd's timeout for sending SIGKILL after SIGTERM is 1m30s
(TimeoutStopSec), which is can be not enough to wait for queries or
shutdown the storages.

And besides in this case shutdown_wait_unfinished server settings are
ignored.

So let's just disable this systemd logic and rely on
shutdown_wait_unfinished instead.

But note shutting down the storages can take a while, but it is better
to give it time instead of killing the process, since killing may lead
to data loss.

Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2023-09-19 22:09:38 +02:00
Azat Khuzhin
dde0a88067 Document shutdown_wait_unfinished/shutdown_wait_unfinished_queries in config.xml
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2023-09-19 22:09:38 +02:00
Azat Khuzhin
4d46753541 Convert shutdown_wait_unfinished into ServerSettings
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2023-09-19 22:09:38 +02:00
Kruglov Pavel
593a94e092
Merge pull request #54806 from azat/revert-54449-parts-prune-indexHint
Revert "Fix filtering parts with indexHint for non analyzer"
2023-09-19 22:08:59 +02:00
Azat Khuzhin
c439c4bca2
Revert "Fix filtering parts with indexHint for non analyzer" 2023-09-19 21:39:21 +02:00
Han Fei
923ffe412f
Merge pull request #54791 from hanfei1991/hanfei/duplicate_index
refine error code of duplicated index in create query
2023-09-19 20:52:45 +02:00
Han Fei
eb86c113e5
Merge pull request #54184 from priera/fix_mv_insertion_when_duplicated_parts
Inserting only non-duplicate chunks in MV
2023-09-19 20:41:45 +02:00
Han Fei
bab0ef5c16 Merge branch 'master' into hanfei/duplicate_index 2023-09-19 20:40:59 +02:00
Nikolay Degterinsky
e217c8b1fd
Merge pull request #54636 from ClickHouse/evillique-patch-1
Fix a bug in addData and subData functions
2023-09-19 20:24:50 +02:00
robot-ch-test-poll4
a3dcce21b3
Merge pull request #54405 from Avogar/json-or-jsonl
Parse data in JSON format as JSONEachRow if failed to parse metadata
2023-09-19 20:15:09 +02:00
Nikolai Kochetov
1323c5c6ac Merge branch 'master' into pr-distributed-prefer-localhost-replica 2023-09-19 17:44:02 +00:00
Kruglov Pavel
d555fdffa5
Merge pull request #54449 from azat/parts-prune-indexHint
Fix filtering parts with indexHint for non analyzer
2023-09-19 19:15:41 +02:00
Robert Schulze
5111f1e090
Update docs/en/operations/query-cache.md
Co-authored-by: Nikita Taranov <nickita.taranov@gmail.com>
2023-09-19 18:59:00 +02:00
alesapin
accbe24e08 Fix test 2023-09-19 18:42:46 +02:00
Robert Schulze
a15029ecb5
Query Cache: Reject queries with non-deterministic functions by default
https://github.com/ClickHouse/support-escalation/issues/963
2023-09-19 16:41:43 +00:00
Yakov Olkhovskiy
b1b49f430a review suggestions 2023-09-19 15:32:58 +00:00
Alexander Tokmakov
51b95abc2b
Update Settings.h (#54754) 2023-09-19 17:19:11 +02:00
Maksim Kita
27d8eefe93 Fixed tests 2023-09-19 17:14:32 +03:00
HarryLeeIBM
c66b60f00f Fix SimHash function issue for s390x 2023-09-19 07:12:14 -07:00
Smita Kulkarni
e2887ad27b Merge branch 'master' into replacing_merge_tree_with_clean_deleted_rows_disabled 2023-09-19 15:58:41 +02:00
Han Fei
3e4eefc700
Update tests/queries/0_stateless/02884_duplicate_index_name.sql
Co-authored-by: Nikolay Degterinsky <43110995+evillique@users.noreply.github.com>
2023-09-19 15:56:46 +02:00
Robert Schulze
83a2969f0c
Merge remote-tracking branch 'rschu1ze/master' into clang-17 2023-09-19 13:38:41 +00:00
Han Fei
ec1f7b333e Merge branch 'master' into fix_mv_insertion_when_duplicated_parts 2023-09-19 15:21:10 +02:00
Han Fei
003f5f77eb refine error code of duplicated index in create query 2023-09-19 15:01:28 +02:00
Robert Schulze
774c4b52da
Rework 2023-09-19 12:20:53 +00:00
slvrtrn
e4e9727572 Update information_schema docs 2023-09-19 14:14:17 +02:00
avogar
f974970c3c Apply suggestion 2023-09-19 11:53:40 +00:00
avogar
5bd2e9f610 Fix tests 2023-09-19 11:53:40 +00:00
avogar
8c29408f5e Parse data in JSON format as JSONEachRow if failed to parse metadata 2023-09-19 11:53:40 +00:00
alesapin
9dcc41cf83 Fxi 2023-09-19 13:47:32 +02:00
alesapin
28b71163b4 Merge branch 'master' into better_exception_in_check_data_part 2023-09-19 13:45:56 +02:00
avogar
268732742b Don't use default move assignment in TimerDescriptor 2023-09-19 11:45:53 +00:00
alesapin
7b1cf9d912 Revert "Better check for exceptions in checkData of non replicated merge tree"
This reverts commit 363ee7cae5.
2023-09-19 13:45:34 +02:00
alesapin
363ee7cae5 Better check for exceptions in checkData of non replicated merge tree 2023-09-19 13:41:55 +02:00
Robert Schulze
1556cdd21a
Merge pull request #54789 from rschu1ze/docs-qc2
Docs: Update query cache docs about usage in view definitions
2023-09-19 13:32:02 +02:00
Mikhail f. Shiryaev
05bec58072
Merge pull request #54790 from ClickHouse/fix-diagnostics-tests
Fix broken tests for clickhouse-diagnostics
2023-09-19 13:17:30 +02:00
Mikhail f. Shiryaev
2e8e4b5766
Fix broken tests for clickhouse-diagnostics 2023-09-19 12:51:34 +02:00