Commit Graph

220 Commits

Author SHA1 Message Date
vdimir
8df4da5efa
Print query in explain plan with parallel replicas 2024-05-23 14:21:38 +00:00
Alexey Milovidov
9597b804e4
Merge pull request #63013 from azat/dist-over-dist-interserver-secret-fix
[RFC] Fix interserver secret for Distributed over Distributed from remote()
2024-05-21 06:04:30 +02:00
Igor Nikonov
20884efdcc Merge remote-tracking branch 'origin/master' into pr-receive-timeout-on-handshake 2024-04-29 13:36:13 +00:00
Azat Khuzhin
3e68103ac8 Fix interserver secret for Distributed over Distributed from remote()
Right if you are executing remote() and later the query will
go to the cluster with interserver secret, then you should have the same
user on the nodes from that cluster, otherwise the query will fail with:

    DB::NetException: Connection reset by peer

And on the remote node:

    <Debug> TCPHandler: User (initial, interserver mode): new_user (client: 172.16.1.5:40536)
    <Debug> TCP_INTERSERVER-Session: d29ecf7d-2c1c-44d2-8cc9-4ab08175bf05 Authentication failed with error: new_user: Authentication failed: password is incorrect, or there is no user with such name.
    <Error> ServerErrorHandler: Code: 516. DB::Exception: new_user: Authentication failed: password is incorrect, or there is no user with such name. (AUTHENTICATION_FAILED), Stack trace (when copying this message, always include the lines below):

The problem is that remote() will not use passed to it user in
any form, and instead, the initial user will be used, i.e. "cli_user"
not "query_user":

    chc --user cli_user -q "select * from remote(node, default, some_dist_table, 'query_user')"

Fix this by using the user from query for the remote().

Note, that the Distributed over Distributed in case of tables still wont
work, for this you have to have the same users on all nodes in all
clusters that are involved in case of interserver secret is enabled (see
also test).

Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>

v2: move client initial_user adjustment into ClusterProxy/executeQuery.cpp
v3: we cannot check for interserver_mode in
    updateSettingsAndClientInfoForCluster() since it is not yet
    interserver in remote() context
2024-04-29 07:12:17 +02:00
Igor Nikonov
1e43e3515e Check table status for parallel replicas 2024-04-17 16:47:52 +00:00
Azat Khuzhin
8a1fe33304 Disable optimize_skip_unused_shards_rewrite_in for composite keys
It never worked, since shardContains() accept only one value, and it
will throw "Not found column X in block" when sharding key consist from
multiple columns.

Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2024-04-15 11:53:56 +02:00
Azat Khuzhin
32ed192434 Fix incorrect sharding key types for optimize_skip_unused_shards_rewrite_in
Before it always uses the first column from sample block, while it is
not guaranteed.

Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2024-04-15 11:53:56 +02:00
Dmitry Novik
10bf164aa7 Cleanup #ci_set_analyzer 2024-03-20 10:47:15 +01:00
Dmitry Novik
221b74c77f Fix #ci_set_analyzer 2024-03-19 19:44:15 +01:00
Dmitry Novik
64b5acf0e4 Code cleanup 2024-03-18 14:24:06 +01:00
Dmitry Novik
7c49d5bbf6 Fix some tests #ci_set_analyzer 2024-03-15 15:35:31 +00:00
Dmitry Novik
cd912074a5 Fixup 2024-03-14 18:29:07 +01:00
Dmitry Novik
7065e650e1 Code cleanup 2024-03-06 14:34:03 +01:00
Dmitry Novik
55053dae44 Some progress 2024-02-29 19:18:06 +01:00
Dmitry Novik
0de2d766fa WIP on different JSONs on shards 2024-02-28 15:30:06 +01:00
Raúl Marín
b71bdbae1b Treat 2+ in allow_experimental_parallel_reading_from_replicas as 2 2024-02-21 15:33:37 +01:00
Igor Nikonov
8748d8c537 UNEXPECTED_CLUSTER error for cluster with more than 1 shard 2024-02-05 15:10:51 +00:00
Igor Nikonov
82d7b22144 Parallel replicas: better replicas failover 2024-02-01 21:06:29 +00:00
Maksim Kita
2a327107b6 Updated implementation 2024-01-25 14:31:49 +03:00
Nikolai Kochetov
65c5ea31a8
Revert "Revert "Allow parallel replicas for JOIN with analyzer [part 1]."" 2024-01-22 17:09:34 +01:00
Alexander Tokmakov
4315d44517
Revert "Allow parallel replicas for JOIN with analyzer [part 1]." 2024-01-22 13:30:35 +01:00
Igor Nikonov
131f71b50a
Revert "Revert flaky" 2024-01-19 13:51:30 +01:00
Raúl Marín
477489a05d Revert "Merge pull request #57235 from ClickHouse/pr-custom-key-failover"
This reverts commit 8ba9b4a7ef, reversing
changes made to 0f39245cb8.
2024-01-19 12:46:05 +00:00
Nikolai Kochetov
733ceaa775 Allow parallel replicas for JOIN with analyzer. 2024-01-15 18:48:12 +00:00
Igor Nikonov
7fd851b4e9 Merge remote-tracking branch 'origin/master' into pr-custom-key-failover 2024-01-08 20:43:20 +00:00
Nikita Taranov
66d2db5283
New parallel replicas coordinator implementation (#57968) 2024-01-04 00:27:04 +01:00
Igor Nikonov
db87ea0b86 Merge remote-tracking branch 'origin/master' into pr-custom-key-failover 2023-12-20 20:48:51 +00:00
Nikita Taranov
d57ac6dfdb
Set replica number to its position in cluster definition (#57800)
* impl

* fix
2023-12-20 17:33:05 +01:00
Raúl Marín
ccff198265
Rename canUseParallelReplicas to canUseTaskBasedParallelReplicas (#58025) 2023-12-19 23:21:19 +01:00
Igor Nikonov
52db759c92 Merge remote-tracking branch 'origin/master' into pr-custom-key-failover 2023-12-18 11:59:13 +00:00
Alexey Milovidov
58396c5546
Merge pull request #57218 from tntnatbry/issue-43666
Issue 43666: Add skip_unavailable_shards as a setting for Distributed table.
2023-12-18 04:48:57 +01:00
Igor Nikonov
c49de7cea4 Fix typo 2023-12-17 08:33:49 +00:00
Igor Nikonov
ec1539728d Fix load balancing for hedged connections 2023-12-16 21:17:01 +00:00
Igor Nikonov
72f1c415f1 Merge remote-tracking branch 'origin/master' into pr-custom-key-failover 2023-12-13 15:03:05 +00:00
Igor Nikonov
c165be76ab
Parallel replicas: friendly settings (#57542) 2023-12-13 14:42:06 +01:00
Gagan Goel
e547db0a8c Issue 43666: Add skip_unavailable_shards as a setting for Distributed table.
This setting, when enabled (disabled by default), allows ClickHouse to
silently skip unavailable shards of a Distributed table during a query
execution, instead of throwing an exception to the client.
2023-12-08 15:43:59 -05:00
Igor Nikonov
87a4c0bde4 Simple cleanup in distributed (while dealing with parallel replicas) 2023-12-05 12:25:02 +00:00
Igor Nikonov
3fec1f4110 Fix clang-tidy warning: move from moved object 2023-12-01 21:01:35 +00:00
Igor Nikonov
45ebe78d32 Cleanup 2023-11-30 21:40:45 +00:00
Igor Nikonov
59daabe95a Some refactoring and cleanup
+ change load balancing for custom key w/o hedged connections
  (need the test though)
2023-11-30 14:08:01 +00:00
Igor Nikonov
25eee6cd01 Fix clang-tidy warnings 2023-11-28 18:06:13 +00:00
Igor Nikonov
e823046646 Fixes 2023-11-27 15:27:04 +00:00
Igor Nikonov
63adf4d20c Remove commented code 2023-11-26 22:07:57 +00:00
Igor Nikonov
774347d231 Parallel replicas custom key: skip unavailable replicas 2023-11-26 21:38:49 +00:00
Kruglov Pavel
8e88bf1348 Revert "Revert "Add a setting max_execution_time_leaf to limit the execution time on shard for distributed query"" 2023-11-14 11:40:48 +00:00
Alexander Tokmakov
0622379ec7
Revert "Add a setting max_execution_time_leaf to limit the execution time on shard for distributed query" 2023-11-13 21:11:07 +01:00
Duc Canh Le
1929901c7d better implementation
Signed-off-by: Duc Canh Le <duccanh.le@ahrefs.com>
2023-11-02 07:30:44 +00:00
Alexey Milovidov
10d3a9b818
Update SelectStreamFactory.cpp 2023-11-01 22:51:14 +03:00
Alexey Milovidov
b2187d4b2e
Merge branch 'master' into ch_add_max_execution_time_leaf 2023-11-01 19:57:34 +01:00
Igor Nikonov
9d95f4e1b6 Cleanup: parallel replica coordinator usage 2023-10-11 15:04:59 +00:00