Commit Graph

524 Commits

Author SHA1 Message Date
Alexander Tokmakov
5db9fbed52 cancel tasks on exception 2024-04-04 22:32:57 +02:00
Azat Khuzhin
b9469e2729 Do not try to INSERT into readonly replicas for Distributed engine
Sometimes replica may be readonly for a long time, and this will make
some INSERT queries fail, but it does not make sense to INSERT into
readonly replica, so let's ignore them.

But note, that this will require to extend TableStatus (not extend, but
introduce new version), that will have is_readonly field.

Also before background INSERT into Distributed does not uses
getManyChecked() which means that they do not request TableStatus
packet, while now they would, though this is minor (just a note).

v2: Add a note about max_replica_delay_for_distributed_queries for INSERT
v3: Skip read-only replicas for async INSERT into Distributed
v4: Remove extra @insert parameter for ConnectionPool*::get*
    It make sense only when the table name had passed --
    ConnectionPoolWithFailover::getManyChecked()
v5: rebase on top LoggerPtr
v6: rebase
v7: rebase
v8: move TryResult::is_readonly into the end

Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2024-03-26 11:21:38 +01:00
Azat Khuzhin
35722be8ec Add ability to override initial INSERT SETTINGS via SYSTEM FLUSH DISTRIBUTED
This is useful to overwrite settings in the initial query during force
flush with SYSTEM FLUSH DISTRIBUTED.

For example imagine that your server is out of queries
(max_max_concurrent_queries_for_all_users had been reached), but you
want to flush the distributed table anyway, after this patch you can
use something like this:

    SYSTEM FLUSH DISTRIBUTED dist SETTINGS max_concurrent_queries_for_all_users=1000000

And also fix flush_on_detach for SYSTEM FLUSH DISTRIBUTED, it should
ignore flush_on_detach.

Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2024-03-24 21:32:34 +01:00
Dmitry Novik
e4209218d4
Merge pull request #60497 from ClickHouse/analyzer-distr-json
Analyzer: Support different ObjectJSON on shards
2024-03-21 16:25:30 +01: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
Azat Khuzhin
8b1df937a5 Use scheduleFromThreadPool for parallel processing in distributed storage
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2024-03-19 13:20:51 +01:00
Azat Khuzhin
929dc6fa12 Attach to query for threads in Distributed engine background ops
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2024-03-19 06:58:38 -04:00
Azat Khuzhin
eb75926e50 Parallel flush of pending INSERT blocks of Distributed engine
Parallelism will work only if you have multi disk policy for table (like
everything in Distributed engine right now).

This will work for DETACH/server shutdown and SYSTEM FLUSH DISTRIBUTED

Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2024-03-19 06:58:38 -04:00
Dmitry Novik
90669ef487 Merge remote-tracking branch 'origin/master' into analyzer-distr-json 2024-03-14 17:43:26 +01:00
Sema Checherinda
5c41727725 http connections pools 2024-03-10 10:00:18 +01:00
Dmitry Novik
23b33e5e32 Merge remote-tracking branch 'origin/master' into analyzer-refactor-constant-name 2024-03-07 14:18:44 +01:00
Anton Popov
c103b0084b
Merge pull request #60205 from CurtizJ/refactor-virtual-columns
Refactoring of virtual columns
2024-03-07 13:38:35 +01:00
Dmitry Novik
d92538ced2
Merge branch 'master' into analyzer-refactor-constant-name 2024-03-06 17:55:52 +01:00
Dmitry Novik
7065e650e1 Code cleanup 2024-03-06 14:34:03 +01:00
Anton Popov
95611889dc fix tests 2024-03-01 18:44:33 +00:00
vdimir
47aa33408b
Resubmit "Analyzer: compute ALIAS columns right after reading"
This reverts commit 8141e1c3d1, reversing
changes made to fb099bbd62.
2024-03-01 14:53:02 +00:00
Anton Popov
8a4e15536b refactoring of virtual columns 2024-02-29 18:01:54 +00:00
Alexander Tokmakov
2dedfd6cf9
Revert "Analyzer: compute ALIAS columns right after reading" 2024-02-29 14:22:07 +01:00
vdimir
5dd81f38fb
Merge pull request #59595 from ClickHouse/vdimir/analyzer/comute_alias_columns
Analyzer: compute ALIAS columns right after reading
2024-02-29 10:28:31 +01:00
Anton Popov
0ceeb13b7f refactoring of virtual columns 2024-02-28 19:58:55 +00:00
Anton Popov
9f8ac76345 Merge remote-tracking branch 'upstream/master' into HEAD 2024-02-28 14:42:37 +00:00
Dmitry Novik
0de2d766fa WIP on different JSONs on shards 2024-02-28 15:30:06 +01:00
Dmitry Novik
33ae650e6a Merge remote-tracking branch 'origin/master' into analyzer-refactor-constant-name 2024-02-27 16:35:28 +01:00
Robert Schulze
4794dc28f0
Merge remote-tracking branch 'ClickHouse/master' into dist/config-settings 2024-02-26 21:57:33 +00:00
vdimir
9f1a0734a1
review fix 2024-02-26 16:15:14 +00:00
vdimir
5a9026f39b
Analyzer: compute ALIAS columns right after reading 2024-02-26 16:15:05 +00:00
Dmitry Novik
42b91201a5 Merge remote-tracking branch 'origin/master' into analyzer-refactor-constant-name 2024-02-26 15:11:57 +00:00
Robert Schulze
1e40b63cb1
Merge remote-tracking branch 'ClickHouse/master' into dist/config-settings 2024-02-26 11:15:51 +00:00
Amos Bird
534da3f40f
Fix more tests 2024-02-26 02:31:59 +08:00
Amos Bird
07a0adceb9
Only use query_info.filter_actions_dag for key analysis 2024-02-26 02:31:55 +08:00
Anton Popov
23f300b581 refactoring of virtual columns 2024-02-21 00:57:35 +00:00
Alexander Tokmakov
ec0986af0b skip sanity checks on secondary create query 2024-02-20 21:59:28 +01:00
Dmitry Novik
11970ddf82
Merge branch 'master' into analyzer-fix-test_select_table_name_from_merge_over_distributed 2024-02-19 14:07:58 +01:00
Alexey Milovidov
681351fe1e
Merge pull request #59987 from nickitat/fix_data_race_storage_distributed
Fix data race in `StorageDistributed`
2024-02-15 02:55:08 +01:00
Nikita Taranov
5f87956fc8 impl 2024-02-14 16:22:14 +01:00
Nikolai Kochetov
666b3d6664
Merge branch 'master' into allow-parallel-replicas-for-join-with-analyzer-2 2024-02-13 11:11:03 +01:00
Dmitry Novik
dd8680018f Analyzer: WIP on test_merge_table_over_distributed/test.py::test_select_table_name_from_merge_over_distributed 2024-02-09 16:43:20 +01:00
Dmitry Novik
b8f74b5b05
Merge pull request #50894 from ClickHouse/storage-merge-aliases-analyzer
Analyzer: support aliases and distributed JOINs in StorageMerge
2024-02-08 11:22:00 +01:00
Nikolai Kochetov
c434748fc1
Merge branch 'master' into allow-parallel-replicas-for-join-with-analyzer-2 2024-02-07 12:25:11 +01:00
Dmitry Novik
d558728281
Merge branch 'master' into storage-merge-aliases-analyzer 2024-02-06 20:24:20 +01:00
Vitaly Baranov
86ac7b14d0 Fix Distributed table engine with a constant sharding key. 2024-02-05 21:56:29 +01:00
Nikolai Kochetov
6b06fcf7fc Fix more tests. 2024-02-05 17:54:15 +00:00
Nikolai Kochetov
b60228af3f Allow to send a chain of subqueries for parallel replicas with analyzer. 2024-02-05 17:05:20 +00:00
Dmitry Novik
722f3db738 Merge remote-tracking branch 'origin/master' into storage-merge-aliases-analyzer 2024-01-30 19:50:01 +00:00
Dmitry Novik
5a34641e91 Merge remote-tracking branch 'origin/master' into fix-analyzer-resolve-distr-id 2024-01-30 07:17:15 +00:00
Azat Khuzhin
4248ae509a Support specifying settings for Distributed engine in config (like for MergeTree)
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2024-01-27 18:06:16 +01:00
Maksim Kita
5bb734a4bb ActionsDAG buildFilterActionsDAG refactoring 2024-01-25 18:24:14 +03:00
Maksim Kita
2a327107b6 Updated implementation 2024-01-25 14:31:49 +03:00
Dmitry Novik
4e5249275e
Do not resolve remote table id on initiator 2024-01-22 16:45:25 +01:00