Commit Graph

2521 Commits

Author SHA1 Message Date
Robert Schulze
b475fbc9a7
Merge pull request #37300 from ClickHouse/cmake-cleanup-pt3
Various cmake cleanups
2022-05-20 10:02:36 +02:00
Sergei Trifonov
2450ab9079
Merge pull request #36686 from azat/disk-least-used
Implement least_used load balancing algorithm for disks inside volume
2022-05-20 09:16:07 +02:00
Robert Schulze
c0d5705891
Merge pull request #37326 from ClickHouse/fix-marks-cache-size-cfg
Provide default value for mark_cache_size
2022-05-19 20:20:25 +02:00
Azat Khuzhin
ba26b3cf4c Implement lead_used load balancing algorithm for disks inside volume
v2: rebase on top removed raid1
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2022-05-19 14:10:11 +03:00
Azat Khuzhin
456444eadb Add storage_configuration example into config.xml
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2022-05-19 14:10:11 +03:00
Azat Khuzhin
29a8a00656 Add ability to pass QueryKind via clickhouse-client/local (useful for debugging)
v2: fix LocalConnection::sendQuery() for Suggest (comes w/o client_info) [1]
    [1]: https://s3.amazonaws.com/clickhouse-test-reports/37290/7c85175963226ff78eec542efafcff4e650aa0f0/stateless_tests__ubsan__actions_.html
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2022-05-19 07:19:27 +03:00
Robert Schulze
a2214760c6
Remove mark_cache_size from further files
- changed config.xml/yaml files used by CH's own internal tests which
  are (hopefully) not sensitive to mark_cache_size being set or not

- further occurrences exist but changing them seems a bad idea (e.g.
  because they are in customer-provided data)
2022-05-18 22:09:14 +02:00
Robert Schulze
8ca58cd5a5
Provide default value for mark_cache_size
I played around with my local config.xml file. The minimal working example is this:
<?xml version="1.0"?>
<clickhouse>
    <mark_cache_size>5368709120</mark_cache_size>
    <listen_host>localhost</listen_host>
    <tcp_port>9000</tcp_port>
    <users_config>users.xml</users_config>
    <logger><console>true</console></logger>
</clickhouse>

Not specifying mark_cache_size made the server not start up:
  2022.05.18 12:15:06.549078 [ 8728320 ] {} <Error> Application: Not found: mark_cache_size

Looking at ClickHouse's ca. 100 server configuration options +
sub-options, it seems that mark_cache_size is NOT special enough to
require explicit configuration but instead that the behavior was
unintended because no default value was provided.
2022-05-18 15:28:19 +02:00
Vitaly Baranov
f34a5cdee2
Merge branch 'master' into ON_CLUSTER-grant 2022-05-17 13:21:20 +02:00
Vitaly Baranov
23a61b1596
Merge pull request #36700 from azat/fix-server-reload
Fix server reload on port change (do not wait for current connections from query context)
2022-05-17 12:25:21 +02:00
Robert Schulze
43945cea1b
Fixing some warnings 2022-05-16 20:59:27 +02:00
Alexey Milovidov
434b8fbf14
Revert "Remove height restrictions from the query div in play web tool." 2022-05-16 19:20:30 +03:00
Azat Khuzhin
c8420c0dbe Remove duplication for server connections check
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2022-05-16 16:22:58 +03:00
Azat Khuzhin
e503f1f22c Keep reloaded servers and currently active in one list
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2022-05-16 16:22:58 +03:00
Azat Khuzhin
f15a5461be Fix server reload on port change (do not wait for current connections)
If you will execute 'SYSTEM RELOAD CONFIG' via, i.e., TCP protocol, then
reload on port change will endlessly wait for connection from which this
query had been issued, and you will see the following message in the
logs:

    2022.04.28 03:34:57.552513 [ 37101 ] {b41d855c-4dbf-470a-a144-c6ae5a1abda8} <Debug> executeQuery: (from 127.0.0.1:11774) system reload config
    ...
    2022.04.28 03:34:57.710640 [ 37101 ] {b41d855c-4dbf-470a-a144-c6ae5a1abda8} <Information> Application: Stopped listening for http://127.0.0.1:18123
    2022.04.28 03:34:57.798774 [ 37101 ] {b41d855c-4dbf-470a-a144-c6ae5a1abda8} <Information> Application: Stopped listening for native protocol (tcp): 127.0.0.1:19000
    ...
    2022.04.28 03:34:57.901375 [ 37101 ] {b41d855c-4dbf-470a-a144-c6ae5a1abda8} <Debug> Application: Server finished: http://127.0.0.1:18123
    2022.04.28 03:34:57.901455 [ 37101 ] {b41d855c-4dbf-470a-a144-c6ae5a1abda8} <Trace> Application: Waiting server to finish: native protocol (tcp): 127.0.0.1:19000
    2022.04.28 03:34:58.001717 [ 37101 ] {b41d855c-4dbf-470a-a144-c6ae5a1abda8} <Trace> Application: Waiting server to finish: native protocol (tcp): 127.0.0.1:19000
    2022.04.28 03:34:58.101881 [ 37101 ] {b41d855c-4dbf-470a-a144-c6ae5a1abda8} <Trace> Application: Waiting server to finish: native protocol (tcp): 127.0.0.1:19000
    ...
    2022.04.28 03:35:01.707951 [ 37101 ] {b41d855c-4dbf-470a-a144-c6ae5a1abda8} <Trace> Application: Waiting server to finish: native protocol (tcp): 127.0.0.1:19000

But waiting for the current connection will never ends.

So instead of waiting directly from the query context (SYSTEM RELOAD
CONFIG) do this in background (actually not even in background, but
check on server reload and on exit).

v0: just don't wait for the servers
v2: fix use-after-free by removing dependency from server in handlers
v3: wait servers in background to avoid use-after-free of the context
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2022-05-16 16:22:58 +03:00
Azat Khuzhin
01e1c5345a Add separate CLUSTER grant
In case you have different roles for the same user on multiple clusters,
ON CLUSTER query can help to overcome some limitations.

Consider the following example:
- cluster_with_data, dev_user (readonly=2)
- stage_cluster, dev_user (readonly=0)

So when you will execute the following query from stage_cluster, it will
be successfully executed, since ON CLUSTER queries has different system
profile:

    DROP DATABASE default ON CLUSTER cluster_with_data

This is not 100% safe, but at least something.

Note, that right now only ON CLUSTER query it self is supported, but
separate clusters are not (i.e. GRANT CLUSTER some_cluster_name TO
default), since right now grants sticked to database+.

v2: on_cluster_queries_require_cluster_grant
v3: fix test and process flags as bit mask
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2022-05-16 13:57:45 +03:00
Robert Schulze
e3cfec5b09
Merge remote-tracking branch 'origin/master' into clangtidies 2022-05-16 10:12:50 +02:00
Azat Khuzhin
40f3dbb448 Ignore harmful env variables in clickhouse binaries (reexec w/o them)
Some environments may really require LD_LIBRARY_PATH (and some other
variables), so rejecting running clickhouse binaries in such envs is a
backward incompatible change.

So instead of rejecting, let's ignore those env variables, i.e. reexec
binaries without them.

Also note, that there is no messages in stderr in case of some of
variables set anymore, since this message may break some scripts.

Refs: #36340
Follow-up for: #36342
2022-05-14 12:08:48 +03:00
Azat Khuzhin
5086d8de29 Reload listen_reuse_port/listen_backlog from config
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2022-05-12 17:05:39 +03:00
kssenii
61f2737e17 Merge master 2022-05-10 19:31:22 +02:00
kssenii
0feda67ec4 Fix progress for insert select 2022-05-10 15:04:08 +02:00
Alexander Tokmakov
9346c9363a
Merge pull request #37052 from ClickHouse/fix_server_termination_stress_tests
Print stacks if we cannot terminate server in stress tests
2022-05-10 13:12:44 +03:00
Sergei Trifonov
9800d80a29
update sanity checks warning message text 2022-05-10 09:31:22 +02:00
Dmitry Novik
adcb792f0d
Merge pull request #35921 from ClickHouse/enable-memory-overcommit
Enable memory overcommit
2022-05-10 02:09:18 +02:00
Alexander Tokmakov
92d423c478 print stacks if wa cannot terminate server in stress tests 2022-05-09 19:43:51 +02:00
guykohen
34c494f403 Remove height restrictions from the query div in play web tool. 2022-05-09 13:32:26 -04:00
mergify[bot]
8ea87a3530
Merge branch 'master' into enable-memory-overcommit 2022-05-09 14:00:54 +00:00
Kruglov Pavel
23bd9390a6
Merge pull request #36997 from vitlibar/users-without-assigned-policies-can-view-rows
Users without assigned row policies can view rows
2022-05-09 12:04:50 +02:00
Robert Schulze
1b81bb49b4
Enable clang-tidy modernize-deprecated-headers & hicpp-deprecated-headers
Official docs:

  Some headers from C library were deprecated in C++ and are no longer
  welcome in C++ codebases. Some have no effect in C++. For more details
  refer to the C++ 14 Standard [depr.c.headers] section. This check
  replaces C standard library headers with their C++ alternatives and
  removes redundant ones.
2022-05-09 08:23:33 +02:00
Vitaly Baranov
69bec2f377 Users without assigned row policies can view rows now. 2022-05-07 14:50:24 +02:00
Alexey Milovidov
a121155f0a Fix conflict 2022-05-07 12:38:30 +02:00
Alexey Milovidov
1bdc51a496 Merge branch 'remind_for_external_option' of github.com:bigo-sg/ClickHouse into bigo-sg-remind_for_external_option 2022-05-07 12:36:57 +02:00
Alexey Milovidov
b2945766d0
Merge pull request #36988 from ClickHouse/handle-nullable-numbers-in-play-ui
Correct styling of Nullable numbers in PlayUI
2022-05-07 13:06:25 +03:00
Alexey Milovidov
a88e9b74a2 Correct styling of Nullable numbers in PlayUI 2022-05-06 21:50:28 +02:00
Alexey Milovidov
8b26c5fe02
Merge pull request #36838 from ClickHouse/config-update
Disable `merge_tree_metadata_cache` by default
2022-05-06 01:59:01 +03:00
Alexey Milovidov
1ba42076e5
Merge pull request #36778 from ClickHouse/init-thread-pools-local-server
Init thread pools for clickhouse-local
2022-05-06 01:52:55 +03:00
mergify[bot]
1a92a34514
Merge branch 'master' into enable-memory-overcommit 2022-05-02 17:04:08 +00:00
Alexey Milovidov
0b9f8d81e4 Add cool processing of empty resultsets 2022-05-02 03:48:48 +02:00
Alexey Milovidov
2f0c421d99
Update play.html 2022-05-02 04:24:40 +03:00
Alexey Milovidov
8b366cbb02
Update play.html 2022-05-02 04:23:52 +03:00
Alexey Milovidov
be7a4b8b30 Make it work automatically; unify the code 2022-05-02 03:19:57 +02:00
Alexey Milovidov
474a805ea7 Merge branch 'play-vertical-format' of github.com:vdimir/ClickHouse into vdimir-play 2022-05-02 02:44:09 +02:00
Nikita Mikhaylov
f2d73635ef Disable 2022-05-01 17:14:52 +00:00
Alexey Milovidov
69ae22070f
Merge pull request #36824 from ClickHouse/log-test-sanity-check
Add sanity check for log level. Fix style.
2022-05-01 14:03:22 +03:00
Nikita Taranov
92f8244932
Fix certs (finishing pr #36457) (#36747) 2022-05-01 12:59:19 +02:00
Robert Schulze
89aa9ae00f
Fixed clang-tidy check "bugprone-branch-clone"
The check is currently *not* part of .clang-tidy. It complains about:
(1) "switch has multiple consecutive identical branches"
(2) "repeated branch in conditional chain"

About (1): Lots of findings in switches were about redundant
"[[fallthrough]]" in places where the compiler would not warn anyways. I
have cleaned these up.

About (2): In if-else_if-else chains, fixing the warning would usually
mean concatenating multiple if-conditions. As this would reduce
readability in most cases, I did not fix these places.

Because of (2), I also refrained from adding "bugprone-branch-clone" to
.clang-tidy.
2022-04-30 19:40:28 +02:00
Alexey Milovidov
47988db1a5 Add sanity check for log level. Fix style. 2022-04-30 13:19:25 +02:00
Alexey Milovidov
e0b2365945
Merge pull request #36472 from ClickHouse/sanity-checks-message-fix
more specific warning text about low disk space
2022-04-30 09:44:21 +03:00
Alexey Milovidov
1ddb04b992
Merge pull request #36715 from amosbird/refactorbase
Reorganize source files so that base won't depend on Common
2022-04-30 09:40:58 +03:00
Alexey Milovidov
dc914c635c
Merge pull request #36497 from tonickkozlov/tonickkozlov/benchmark/allow-auth-env
Benchmark can read auth from environment variables
2022-04-30 08:55:15 +03:00