Commit Graph

170 Commits

Author SHA1 Message Date
Azat Khuzhin
3c7e765b27 DDLWorker: process unfinished tasks only after reinitialization 2021-02-28 05:45:12 +03:00
Azat Khuzhin
54b1496408 DDLWorker: optimize processing of unfinished tasks
Do not look at zookeeper if was_executed is false
2021-02-28 05:45:12 +03:00
Azat Khuzhin
eeda1fe756 DDLWorker: wait for pending async tasks 2021-02-28 05:45:12 +03:00
Azat Khuzhin
0cd67ed051 DDLWorker: remove only completed tasks (significant for distributed_ddl.pool_size > 1)
Otherwise it will SIGSEGV due to invalid-read (UAF).
2021-02-28 05:45:12 +03:00
Azat Khuzhin
7481b05d27 DDLWorker: avoid comparing pointers for getting min element
The current_tasks always updated with emplace_back, so front() is ok.
2021-02-28 05:45:11 +03:00
Azat Khuzhin
78c6e0527d DDLWorker: Fix reference to zookeeper with distributed_ddl.pool_size > 1 (thread pool) 2021-02-28 05:45:11 +03:00
Alexander Tokmakov
2a36d6cb55 review suggestions 2021-02-20 02:41:58 +03:00
Alexander Tokmakov
1aac7b3471 Merge branch 'master' into database_replicated 2021-02-17 00:39:56 +03:00
Alexander Tokmakov
7b54b892b5 fix 2021-02-16 17:05:58 +03:00
Alexander Tokmakov
9c7cf9e92e remove some debug code 2021-02-15 13:26:34 +03:00
Alexander Tokmakov
320fd6b264 startup without zk 2021-02-15 03:04:46 +03:00
Alexander Tokmakov
184ec67dac better ddl queue cleanup 2021-02-12 22:23:50 +03:00
Alexander Tokmakov
f64f9b672b fix 2021-02-12 19:22:01 +03:00
Alexander Tokmakov
c9cf63e958 fix 2021-02-12 01:23:40 +03:00
Alexander Tokmakov
9afb16759e fix 2021-02-11 18:14:38 +03:00
Alexander Tokmakov
15256d86e5 better replica recovery and queue cleanup 2021-02-10 23:30:40 +03:00
Alexander Tokmakov
2c6a0e74fb better replica creation 2021-02-09 18:14:20 +03:00
alesapin
cb1194d37a Add final to some classes 2021-02-09 12:05:54 +03:00
Alexander Tokmakov
78c1d69b8c better code 2021-02-08 22:36:17 +03:00
tavplubix
ac477d9850
Merge pull request #19771 from ClickHouse/thread_state_improvements
Minor code improvements around ThreadStatus
2021-02-08 22:34:55 +03:00
Alexander Tokmakov
7ce0ef2561 show clusters for replicated db 2021-02-08 12:14:17 +03:00
Alexander Tokmakov
18f6b5bbad add timeouts 2021-02-04 22:41:44 +03:00
Alexander Tokmakov
066fb4c82b fix 2021-02-03 23:02:37 +03:00
Alexander Tokmakov
d010f97db0 Merge branch 'master' into database_replicated 2021-02-03 20:13:25 +03:00
tavplubix
50362840bb
Merge pull request #19924 from amosbird/ddlworker2
Initialize MaxDDLEntryID upon restarting
2021-02-03 13:22:22 +03:00
Alexander Tokmakov
0073c87d5d fix 2021-02-02 13:32:42 +03:00
tavplubix
37c178f5e1
Update DDLWorker.cpp 2021-02-02 10:32:01 +08:00
tavplubix
8e6b09b1ae
Update DDLWorker.cpp 2021-02-02 10:32:01 +08:00
Amos Bird
a7eb2ce6d0
initialize MaxDDLEntryId upon restarting 2021-02-02 10:32:01 +08:00
Alexander Tokmakov
9da445e740 execute initial query in the same thread 2021-02-01 22:29:47 +03:00
yiguolei
768e461d28 add functional test 2021-02-01 10:40:48 +08:00
Alexander Tokmakov
a57456a3fd fix 2021-01-28 22:02:39 +03:00
Alexander Tokmakov
ffaa8e34a6 minor code improvements around ThreadStatus 2021-01-28 16:57:36 +03:00
Alexander Tokmakov
52e5c0aad7 fix thread status 2021-01-28 16:48:17 +03:00
yiguolei
b0d645eea8 check active replicas and detached tables 2021-01-28 20:12:00 +08:00
yiguolei
6693f77c32 fix code style 2021-01-27 13:56:36 +08:00
guoleiyi
9d086f445d Should fail ddl query as soon as possible if table is shutdown 2021-01-27 10:58:07 +08:00
Alexander Tokmakov
f20d5e3b41 fix 2021-01-26 20:51:25 +03:00
Alexander Tokmakov
3146a1a954 fix 2021-01-25 21:59:23 +03:00
Alexander Tokmakov
769257acf4 fix drop table on cluster hang 2021-01-25 15:44:10 +03:00
Alexander Tokmakov
7f97a11c84 Merge branch 'master' into database_replicated 2021-01-18 17:09:39 +03:00
tavplubix
6022311a37
Merge pull request #18285 from weeds085490/hotfix/abort_when_failed_to_init_ddlworker
exit clickhouse when failing to initialize zookeeper with logical err…
2021-01-11 17:04:33 +03:00
tavplubix
213c653ef8
Merge pull request #17656 from bharatnc/ncb/ddl-worker-queue-table
add  system.distributed_ddl_queue table
2021-01-11 14:59:26 +03:00
bharatnc
1e579ac375 Fixes to code, build and style checks 2021-01-07 11:10:49 -08:00
bharatnc
f0ea07b493 DDLLogEntry.parse() to populate query and initiator 2021-01-07 11:10:41 -08:00
bharatnc
5af6f11325 DLLWorkerQueueTable - remove unimplemented function 2021-01-07 11:10:40 -08:00
bharatnc
2c1f9e2a77 DDLWorkerQueueTable - add intial scaffolding 2021-01-07 11:10:40 -08:00
Amos Bird
a32f6dcf1b
Apply alter settings on cluster to all replicas 2021-01-06 20:08:46 +08:00
Alexander Tokmakov
f2fca15393 try fix it better way 2020-12-30 15:25:00 +03:00
roverxu
f90719fef8 exit clickhouse when failing to initialize zookeeper with logical error in DDLWorker 2020-12-21 10:05:23 +08:00
Amos Bird
8d0e949462
ddlworker max entry metric 2020-12-12 14:20:49 +08:00
Alexander Tokmakov
9f3c77f62e add zk ops into task 2020-12-04 23:12:32 +03:00
Ilya Yatsishin
2e9f10ab3e
Merge pull request #17767 from bharatnc/ncb/refact-zk-path
Improve zookeeper path concatenation inside DDLWorker
2020-12-04 14:34:05 +03:00
Ivan
315ff4f0d9
ANTLR4 Grammar for ClickHouse and new parser (#11298) 2020-12-04 05:15:44 +03:00
bharatnc
a8fea625ae simplify path concat 2020-12-03 10:29:32 -08:00
Alexander Tokmakov
39532f7d9e slightly better DDLWorker initialization and restarting 2020-12-03 21:14:27 +03:00
bharatnc
d05d7e8b06 fix missing import 2020-12-03 09:08:17 -08:00
bharatnc
0efe16f9ce concatenate paths using fs::path 2020-12-03 09:04:24 -08:00
bharatnc
44e8e30bf1 removed unused imports 2020-12-03 08:43:22 -08:00
Alexander Tokmakov
1a4bd67736 fixes 2020-12-01 20:20:42 +03:00
Alexander Tokmakov
ab197a49c8 better code, fixes 2020-11-30 23:12:43 +03:00
Alexander Tokmakov
fe7c3cb865 fix race on is_circular_replicated 2020-11-30 18:31:02 +03:00
Alexander Tokmakov
f1a52a609b separate DatabaseReplicatedDDLWorker 2020-11-27 17:04:03 +03:00
Alexander Tokmakov
5ccf975a4a Merge branch 'master' into database_replicated 2020-11-24 14:38:02 +03:00
Alexander Tokmakov
dad21ee684 maintain metadata in zk 2020-11-24 13:24:39 +03:00
Alexander Tokmakov
7ab4445e99 try another approach 2020-11-20 19:06:27 +03:00
Alexander Tokmakov
2283906a11 try support replica recovery 2020-11-19 13:34:45 +03:00
alesapin
d4dbf928b4
Update src/Interpreters/DDLWorker.cpp
Co-authored-by: tavplubix <avtokmakov@yandex-team.ru>
2020-11-17 14:04:27 +03:00
alesapin
9f71f03be3 Fix DDL worker task execution on single replica 2020-11-16 15:34:12 +03:00
Alexander Tokmakov
b0262b3d06 better replica creation 2020-11-13 21:35:45 +03:00
Alexander Tokmakov
0731bfb7be Merge branch 'master' into database_replicated 2020-11-12 21:04:18 +03:00
Alexander Tokmakov
2a6c0b9180 try reuse DDLWorker in DatabaseReplicated 2020-11-12 20:35:29 +03:00
Alexander Tokmakov
cbcdee0cf9 split DDLWorker.cpp 2020-11-03 16:47:26 +03:00
Alexander Tokmakov
d8ae9fcdb4 fixes, add shard name 2020-11-03 14:30:53 +03:00
Alexey Milovidov
f573aeb97e Whitespace 2020-10-28 03:32:31 +03:00
alesapin
dc1a5abea9 Remove cluster type check during alter 2020-10-16 14:59:58 +03:00
alesapin
cfe9a0c4a1 Fix event subscription in DDLWorker 2020-09-30 17:58:27 +03:00
Azat Khuzhin
c9baceb760 Change thread name for DDLWorker executor threads 2020-09-17 21:07:14 +03:00
Azat Khuzhin
dd867b787f Allow parallel execution of distributed DDL
Add distributed_ddl.pool_size to control maximum parallel to handle
distributed DDL.

Also:
- convert Exception constructors to fmt-like
- use sleepFor* over std::this_thread::sleep_for()
2020-09-12 02:32:08 +03:00
Winter Zhang
3d1d64ec60
Fix currentDatabase function cannot be used in ON CLUSTER ddl query. (#14211) 2020-09-09 12:58:59 +03:00
alesapin
0177b35998 Review fixes 2020-08-24 12:07:37 +03:00
alesapin
f5730a3a5f Merge branch 'master' into fix_ddl_worker_timeouts 2020-08-24 11:50:11 +03:00
Alexey Milovidov
eeb769d2d4 Remove useless code around zkutil 2020-08-18 22:02:07 +03:00
Alexey Milovidov
12f66fa82c Fix 99% of typos 2020-08-08 04:01:47 +03:00
alesapin
77b8c9e332 Fix DDL worker 2020-08-07 12:18:34 +03:00
Vitaly Baranov
c39eb8f71b Fix partial revokes (complex cases). 2020-06-30 18:47:02 +03:00
Alexey Milovidov
5211a42c04 Remove leader election, step 3 2020-06-19 17:18:58 +03:00
Nikita Mikhaylov
edff6eac6e comment 2020-06-17 11:44:52 +03:00
Nikita Mikhaylov
fc06f99476 build and test fixes 2020-06-16 21:07:41 +03:00
frank
e26e873b0d fix for style check.
(cherry picked from commit 0be7b09490)
2020-06-16 11:54:01 +03:00
franklee
afa666792b typo
(cherry picked from commit 76c75c947e)
2020-06-16 11:53:52 +03:00
franklee
264e44ecef support distributed DDLs on cross replication clusters.
(cherry picked from commit fd09994d91)
2020-06-16 11:53:27 +03:00
Alexey Milovidov
72257061d5 Avoid errors due to implicit int<->bool conversions when using ZK API 2020-06-12 18:09:12 +03:00
Alexey Milovidov
25f941020b Remove namespace pollution 2020-05-31 00:57:37 +03:00
Alexander Tokmakov
c071e0a473 add context to DatabaseCatalog methods 2020-05-29 02:01:18 +03:00
Alexey Milovidov
7e1813825b Return old names of macros 2020-05-24 01:24:01 +03:00
Alexey Milovidov
cd6d3c7509 Progress on task 2020-05-23 22:55:06 +03:00
Alexey Milovidov
d5b7883451 find {base,src,programs} -name '*.h' -or -name '*.cpp' | xargs grep -l -P 'LOG_[^\_(]+\([^,]+, "[^"]+" << [^<]+ << "[^"]+" << [^<]+ << "[^"]+" << [^<]+ << "[^"]+"\);' | xargs sed -i -r -e 's/(LOG_[^\_(]+)\(([^,]+), "([^"]+)" << ([^<]+) << "([^"]+)" << ([^<]+) << "([^"]+)" << ([^<]+) << "([^"]+)"\);/\1_FORMATTED(\2, "\3{}\5{}\7{}\9", \4, \6, \8);/' 2020-05-23 22:41:08 +03:00
Alexey Milovidov
7e2fb9ad65 Apply all transformations again 2020-05-23 22:38:30 +03:00
Alexey Milovidov
eacff92d0e Progress on task 2020-05-23 22:35:08 +03:00