Commit Graph

16110 Commits

Author SHA1 Message Date
Alexey Milovidov
d112492c56 Remove some code 2024-01-13 03:48:04 +01:00
Artem Alperin
4139cb24ee
Add missing includes 2024-01-13 01:48:55 +03:00
Nikita Mikhaylov
8edab24189
Add comments to all columns of system tables (#58356) 2024-01-12 16:39:22 +01:00
Robert Schulze
b183e1f048
Merge remote-tracking branch 'rschu1ze/master' into Improvement/inverted_index_support_match 2024-01-12 14:10:11 +00:00
Robert Schulze
d11ed921be
Some fixups 2024-01-12 14:05:19 +00:00
Anton Popov
8e88605a7c Merge remote-tracking branch 'upstream/master' into HEAD 2024-01-12 03:55:15 +00:00
Konstantin Bogdanov
633ef126c7
Merge pull request #57550 from ClickHouse/nickitat-patch-15
Small change in log message in MergeTreeDataMergerMutator
2024-01-12 02:02:10 +03:00
Anton Popov
eb6647d4e8 fix reading of offsets subcolumn from Nested 2024-01-11 21:55:22 +00:00
Robert Schulze
790f5890a0
Merge pull request #58611 from rschu1ze/qc-isolation
Improve isolation of query cache entries under re-created users or role switches
2024-01-11 17:30:24 +01:00
Nikolai Kochetov
f83cf1a6b7
Merge pull request #58638 from amosbird/fix-58620
Fix broken partition key analysis when doing projection optimization
2024-01-11 14:17:48 +01:00
Nikita Mikhaylov
baf4e5e894
Added comments for system tables (#48350) 2024-01-11 12:50:00 +01:00
Duc Canh Le
6331d8a6f2 Merge branch 'master' into final_no_copy
Resolve conflicts

Signed-off-by: Duc Canh Le <duccanh.le@ahrefs.com>
2024-01-11 02:55:14 +00:00
Igor Nikonov
8d4a395afa Merge remote-tracking branch 'origin/master' into pr-custom-key-failover 2024-01-10 20:28:04 +00:00
Robert Schulze
52d75ab68f
Merge pull request #58458 from rschu1ze/replace-std_regexp-by-re2
Replace `std::regex` by re2
2024-01-10 17:46:54 +01:00
Kseniia Sumarokova
a6b5b7460b
Merge branch 'master' into broken-projections-better-handling 2024-01-10 16:46:18 +01:00
Dmitry Novik
ddbdd89904 Analyzer: Correctly handle constant set in index 2024-01-10 14:34:56 +00:00
Anton Popov
e87c62eead
Merge pull request #58628 from CurtizJ/remove-projections-code-2
Remove more projections code
2024-01-10 15:29:15 +01:00
Robert Schulze
fee98994d4
Fix tokenization in DataPartsExchange (it missed the last element) 2024-01-10 11:44:01 +00:00
Robert Schulze
499227b9cf
Merge remote-tracking branch 'rschu1ze/master' into replace-std_regexp-by-re2 2024-01-10 10:02:53 +00:00
Robert Schulze
36173bbb7b
Merge remote-tracking branch 'rschu1ze/master' into qc_isolation 2024-01-10 09:57:13 +00:00
Robert Schulze
4cacfa6b43
Merge pull request #57509 from jinjunzh/qatzstd_main
Add Intel-QAT-based `ZSTD_QAT` compression codec
2024-01-10 10:31:39 +01:00
Kseniia Sumarokova
1b517105db
Merge pull request #57323 from valbok/mysql-binlog-client
MaterializedMySQL: Introduce MySQL Binlog Client
2024-01-10 09:08:13 +01:00
Alexey Milovidov
4c1841e475 Merge branch 'master' into insert-quorum-host-name-check 2024-01-10 05:17:37 +01:00
Robert Schulze
ced9e93ac6
Merge remote-tracking branch 'rschu1ze/master' into qatzstd_main 2024-01-09 20:36:02 +00:00
Amos Bird
29afac61cc
Fix partition key analysis 2024-01-10 03:13:03 +08:00
pufit
6cf55b82f4
Merge pull request #58539 from canhld94/file_custom_compress_level
Allow explicitly set compression level in output format
2024-01-09 13:43:38 -05:00
Robert Schulze
c04e4eb162
Merge remote-tracking branch 'rschu1ze/master' into qc-isolation 2024-01-09 16:30:20 +00:00
Anton Popov
e0d469b0e0 remove more projections code 2024-01-09 15:48:08 +00:00
Dmitry Novik
629d4b921e Fix style 2024-01-09 15:38:04 +00:00
Dmitry Novik
11280cbde1 Merge remote-tracking branch 'origin/master' into storage-merge-aliases-analyzer 2024-01-09 15:10:59 +00:00
Anton Popov
2fd0f7be7b
Merge pull request #55579 from CurtizJ/remove-old-projections-code
Remove more old code of projection analysis
2024-01-09 15:51:12 +01:00
Jayme Bird
b451c04e75 fixup wait for all replicas if no src_replicas are specified 2024-01-09 14:02:48 +00:00
Sema Checherinda
7c7e72c4b7
Merge pull request #58573 from ClickHouse/chesema-s3-client-creation
fix and test that S3Clients are reused
2024-01-09 13:28:20 +01:00
Robert Schulze
e9b6f413b8
Get rid of QueryCache::user_name 2024-01-09 12:24:12 +00:00
Igor Nikonov
f566423e19 Merge remote-tracking branch 'origin/master' into pr-custom-key-failover 2024-01-09 10:38:43 +00:00
Yakov Olkhovskiy
cfa41e7dc6
Merge pull request #58038 from ClickHouse/revert-58022-revert-57555-ft-dropped_tables_parts
Add system.dropped_tables_parts table - second attempt
2024-01-09 00:47:07 -05:00
Robert Schulze
fabc06995e
Improve isolation of query results in query cache
Fixes #58054
2024-01-08 20:52:30 +00:00
Igor Nikonov
7fd851b4e9 Merge remote-tracking branch 'origin/master' into pr-custom-key-failover 2024-01-08 20:43:20 +00:00
jinjunzh
cf53d9a17c add USE_QAT into build_options 2024-01-08 11:05:36 -05:00
Anton Popov
3e933c9099 Merge remote-tracking branch 'upstream/master' into HEAD 2024-01-08 15:33:38 +00:00
Jayme Bird
f67e283968 review fixup: simplify conditions and add meaningful comment on why we have these conditions 2024-01-08 10:02:09 +00:00
Jayme Bird
9734934d84 review fixup: don't pass in zookeeper 2024-01-08 10:02:09 +00:00
Jayme Bird
382f6404bf fix getChildren from Keeper 2024-01-08 10:02:09 +00:00
Jayme Bird
5221b4f9bc switch to contains to be more readable 2024-01-08 10:02:09 +00:00
Jayme Bird
18b7f1de5f various fixups 2024-01-08 10:02:09 +00:00
Jayme Bird
b1580efffa switch to use comma join seperated list of srcReplicas 2024-01-08 10:02:09 +00:00
Jayme Bird
128a421d84 add from <srcReplica> modified to SYSTEM SYNC REPLICA LIGHTWEIGHT 2024-01-08 10:02:09 +00:00
Raúl Marín
8f998eaa82
Merge pull request #58447 from canhld94/fix_symlink_in_user_files
Allow users to work with symlinks in user_files_path (again)
2024-01-08 10:40:36 +01:00
Robert Schulze
6665d23243
Merge pull request #58029 from skyoct/feat/server_settings
Add `changeable_without_restart` column to `system.server_settings`
2024-01-08 10:09:51 +01:00
Robert Schulze
c11a2fcb7f
Fix style 2024-01-08 08:50:34 +00:00
Duc Canh Le
149de9aa93 discard fs::canonical return
Signed-off-by: Duc Canh Le <duccanh.le@ahrefs.com>
2024-01-08 03:40:48 +00:00
Robert Schulze
f553b55e3a
Merge remote-tracking branch 'rschu1ze/master' into regex-std-re2 2024-01-07 22:31:35 +00:00
Robert Schulze
8e804487f3
Some fixups 2024-01-07 22:28:08 +00:00
Sema Checherinda
6f626d8294 fix auth_settings.hasUpdates function 2024-01-07 23:00:26 +01:00
Alexander Tokmakov
371d664667
Update MergeTreeData.cpp 2024-01-07 17:27:22 +01:00
Robert Schulze
53965bb9f1
Merge remote-tracking branch 'rschu1ze/master' into qatzstd_main 2024-01-07 14:11:22 +00:00
Robert Schulze
e947ed710b
Hijack and document 'update' map to represent reload status 2024-01-07 13:09:27 +00:00
Sema Checherinda
d5f86f671d fix and test that S3Clients reused 2024-01-07 02:19:06 +01:00
Anton Popov
8c9cf394b3 Merge remote-tracking branch 'upstream/master' into HEAD 2024-01-06 20:58:17 +00:00
Nikolai Kochetov
105789b936
Merge pull request #53705 from ClickHouse/analyzer-execution-names
Analyzer: always qualify execution names
2024-01-06 17:39:58 +01:00
Anton Popov
48a7402b34 fix build 2024-01-06 16:39:27 +00:00
Nikolai Kochetov
c2f00bc75a
Merge pull request #58480 from ClickHouse/try-to-remove-pk-analysis-on-ast
Check if I can remove KeyCondition analysis on AST.
2024-01-06 12:40:46 +01:00
Anton Popov
f252412915 Merge remote-tracking branch 'upstream/master' into HEAD 2024-01-06 03:08:52 +00:00
Alexey Milovidov
e24ec55451
Merge pull request #58482 from ClickHouse/fix_new_intersecting_parts
Fix a stupid case of intersecting parts
2024-01-05 21:53:21 +01:00
Alexander Tokmakov
f94f33c554
Merge pull request #57755 from azat/rmt/ALTER_METADATA-MERGE_PARTS-race
[RFC] Eliminate possible race between ALTER_METADATA and MERGE_PARTS
2024-01-05 17:11:57 +01:00
Sergei Trifonov
8d6b012223
Merge pull request #57877 from azat/merges-mutations-throttling
Add ability to throttle merges/mutations
2024-01-05 17:08:50 +01:00
Nikolai Kochetov
c6858f8666 Fixing tidy 2024-01-05 15:22:41 +00:00
Nikolai Kochetov
8bcfa888a5 Fixing index hint 2024-01-05 11:50:09 +00:00
Nikolai Kochetov
eff6232418 Merge branch 'master' into try-to-remove-pk-analysis-on-ast 2024-01-05 10:54:46 +00:00
Nikolai Kochetov
15b66031bc Update prepared sets. 2024-01-05 10:53:07 +00:00
Nikolai Kochetov
80c1e59d3f Merge branch 'master' into analyzer-execution-names 2024-01-05 09:31:25 +00:00
sunny19930321
8c8f7c83ff hive threadpool read orc failed 2024-01-05 15:58:17 +08:00
sunny19930321
f9b57bfb2c fix: hive threadpool read orc failed 2024-01-05 14:36:28 +08:00
Robert Schulze
2166df0640
Merge pull request #57882 from lingtaolf/optimization/BF_support_rg
Utilize `ngrambf` and `tokenbf` indexes by function `match()`
2024-01-05 00:00:50 +01:00
Nikolai Kochetov
85c1bb80fd Merge branch 'master' into hdfs-virtuals 2024-01-04 18:00:10 +00:00
Nikolai Kochetov
85ea5c1f82 Remove more code 2024-01-04 17:46:06 +00:00
Robert Schulze
f276a7f9d4
Merge remote-tracking branch 'ClickHouse/master' into optimization/BF_support_rg 2024-01-04 17:15:17 +00:00
Alexander Tokmakov
9f5015737b fix a stupid case of intersecting parts 2024-01-04 17:45:42 +01:00
Nikolai Kochetov
494a32f4e4 Review fixes 2024-01-04 14:41:04 +00:00
Kruglov Pavel
7e6e835e2e
Merge pull request #57520 from Avogar/ignore-mv-with-dropped-target-table
Ignore MVs with dropped target table during pushing to views
2024-01-04 15:33:27 +01:00
Duc Canh Le
2e14cfb526 add settings for output compression level and window size
Signed-off-by: Duc Canh Le <duccanh.le@ahrefs.com>
2024-01-04 08:16:00 +00:00
Nikita Taranov
66d2db5283
New parallel replicas coordinator implementation (#57968) 2024-01-04 00:27:04 +01:00
Nikolai Kochetov
7a271f09ed Check if I can remove KeyCondition analysis on AST. 2024-01-03 17:50:46 +00:00
Nikolai Kochetov
d06de83ac1 Fix KeyCondition for file/url/s3 2024-01-03 17:44:28 +00:00
János Benjamin Antal
81b5d8fddd Delay reading from StorageKafka by creating a query plan step 2024-01-03 17:13:41 +00:00
Anton Popov
cf4604bfb6 fix build and tests 2024-01-03 16:59:13 +00:00
Anton Popov
ce1b978a2d Merge remote-tracking branch 'upstream/master' into HEAD 2024-01-03 16:01:44 +00:00
Anton Popov
7dd128f90f Revert "remove projection from StorageSnapshot"
This reverts commit a01acf5d2a.
2024-01-03 16:00:50 +00:00
Anton Popov
6b6f395cc7
Merge pull request #57631 from Avogar/cache-for-reading-compact-subcolumns
Read column once while reading more that one subcolumn from it in Compact parts
2024-01-03 16:31:54 +01:00
Nikolai Kochetov
a3a24bdb40 Merge branch 'master' of github.com:ClickHouse/ClickHouse into hdfs-virtuals 2024-01-03 15:10:57 +00:00
Nikolai Kochetov
7834519212
Merge pull request #58255 from ClickHouse/filter-virtual-columns-storage-merge
Refactor StorageMerge virtual columns filtering.
2024-01-03 16:09:49 +01:00
Robert Schulze
8d4b519bb1
Replace std::regex by re2 2024-01-03 15:06:20 +00:00
Val Doroshchuk
5c221d123d MaterializedMySQL: Introduce MySQL Binlog Client
One binlog connection for many databases.

Suggesting to disable this feature by default for now. It should be explicitly enabled by SETTINGS use_binlog_client=1.
But if you would permanently enable it in MaterializedMySQLSettings, it should keep old behavior and all tests should pass too.

1. Introduced `IBinlog` and its impl to read the binlog events from socket - `BinlogFromSocket`, or file - `BinlogFromFile`. Based on prev impl of `EventBase` and the same old binlog parsers. It fully keeps BC with old version. Fixed `./check-mysql-binlog` to test new impl.
2. Introduced `BinlogEventsDispatcher`, it reads the event from the source `IBinlog` and sends it to currently attached `IBinlog` instances.
3. Introduced `BinlogClient`, which is used to group a list of `BinlogEventsDispatcher` by MySQL binlog connection which is defined by `user:password@host:port`. All dispatchers with the same binlog position should be merged to one.
4. Introduced `BinlogClientFactory`, which is a singleton and it is used to track all binlogs created over the instance.
5. Introduced `use_binlog_client` setting to `MaterializedMySQL`, which forces to reuse a `BinlogClient` if it already exists in `BinlogClientCatalog` or create new one. By default, it is disabled.
6. Introduced `max_bytes_in_binlog_queue` setting to define the limit of bytes in binlog's queue of events. If bytes in the queue increases this limit, `BinlogEventsDispatcher` will stop reading new events from source `IBinlog` until the space for new events will be freed.
7. Introduced `max_milliseconds_to_wait_in_binlog_queue` setting to define max ms to wait when the max bytes exceeded.
7. Introduced `max_milliseconds_to_wait_in_binlog_queue` setting to define max ms to wait when the max bytes exceeded.
8. Introduced `max_bytes_in_binlog_dispatcher_buffer` setting to define max bytes in the binlog dispatcher's buffer before it is flushed to attached binlogs.
9. Introduced `max_flush_milliseconds_in_binlog_dispatcher` setting to define max milliseconds in the binlog dispatcher's buffer to wait before it is flushed to attached binlogs.
10. Introduced `system.mysql_binlogs` system table, which shows a list of active binlogs.
11. Introduced `UnparsedRowsEvent` and `MYSQL_UNPARSED_ROWS_EVENT`, which defines that an event is not parsed and should be explicitly parsed later.
12. Fixed bug when not possible to apply DDL since syntax error or unsupported SQL.

@larspars is the author of following:
`GTIDSets::contains()`
`ReplicationHelper`
`shouldReconnectOnException()`
2024-01-03 15:26:09 +01:00
Nikolai Kochetov
9dc1f4d99c
Update StorageMerge.cpp 2024-01-03 14:53:40 +01:00
Kruglov Pavel
c8acc7c2d1
Fix build 2024-01-03 14:44:00 +01:00
Nikolai Kochetov
aee933a437 Merge branch 'master' into hdfs-virtuals 2024-01-03 12:16:57 +00:00
Nikolai Kochetov
d5dcb6661d Review fixes. 2024-01-03 10:12:08 +00:00
Nikolai Kochetov
78776a060c
Update src/Storages/StorageMerge.cpp
Co-authored-by: Dmitry Novik <n0vik@clickhouse.com>
2024-01-03 11:06:57 +01:00
Nikolai Kochetov
eeed23b1bc Fix sanitizer assert. 2024-01-03 09:45:25 +00:00
Duc Canh Le
12fda5f309 fix 02771_multidirectory_globs_storage_file
Signed-off-by: Duc Canh Le <duccanh.le@ahrefs.com>
2024-01-03 09:22:29 +00:00
Duc Canh Le
3502245ecb use fs::absolute instead of fs::canonical
To allow users to work with symlinks in user_files_path

Signed-off-by: Duc Canh Le <duccanh.le@ahrefs.com>
2024-01-03 04:58:26 +00:00
Alexey Milovidov
44432b1ffc Fix build 2024-01-02 21:54:13 +01:00
Alexey Milovidov
deac0b5f3e Merge branch 'master' into insert-quorum-host-name-check 2024-01-02 21:46:12 +01:00
avogar
488e36de46 More fixes 2024-01-02 20:20:39 +00:00
Nikolai Kochetov
9c25cb6692 Cleanup 2024-01-02 18:08:04 +00:00
Nikolai Kochetov
4f99a8bc1f Remove more unused code. 2024-01-02 17:54:20 +00:00
Nikolai Kochetov
1b20ce5162 Cleanup 2024-01-02 17:50:06 +00:00
Nikolai Kochetov
c808b03e55 Remove unneeded code 2024-01-02 17:27:33 +00:00
Nikolai Kochetov
8936c8376a Use predicate in getTaskIteratorExtension. 2024-01-02 17:14:16 +00:00
avogar
c5ba97f0cd Fix tests 2024-01-02 16:38:45 +00:00
Kruglov Pavel
f2dfe8bdda
Fix build 2024-01-02 16:42:17 +01:00
Nikolai Kochetov
3e3fed1cbe Add reading step to URL 2024-01-02 15:18:13 +00:00
Nikolai Kochetov
0f76967f97 Add reading step to Azure. 2024-01-02 13:46:08 +00:00
Alexander Tokmakov
d13abac912
Merge pull request #58333 from ClickHouse/fix_no_such_key_detached_part
Fix lost blobs after dropping a replica with broken detached parts
2024-01-02 14:21:55 +01:00
Nikolai Kochetov
b7cc6d4615 Fixing tests. 2024-01-02 13:08:04 +00:00
Duc Canh Le
d623702378 Merge branch 'master' into final_no_copy
Resolve conflicts

Signed-off-by: Duc Canh Le <duccanh.le@ahrefs.com>
2024-01-02 06:07:49 +00:00
Bharat Nallan Chakravarthy
00b5e28d6a Merge upstream/master into ncb/system-database-engines 2023-12-30 23:10:48 -08:00
Bharat Nallan Chakravarthy
3c4ac0ba08 add system.database_engines table 2023-12-30 20:31:25 -08:00
Alexey Milovidov
7bded0a5e7
Merge pull request #58316 from ClickHouse/reintroduce_is_deleted
Re-introduce `is_deleted` column for ReplacingMergeTree
2023-12-31 00:57:19 +01:00
Alexey Milovidov
063463b0a8
Merge pull request #58359 from ClickHouse/all-system-tables-local
Attach all system tables in `clickhouse-local`
2023-12-30 17:51:27 +01:00
Alexey Milovidov
c9467d8d47
Update ReplicatedMergeTreeSink.cpp 2023-12-30 15:19:50 +03:00
Alexey Milovidov
2421173574
Merge branch 'master' into insert-quorum-host-name-check 2023-12-30 13:13:24 +01:00
Alexey Milovidov
8fc05e25fe
Merge pull request #58310 from azat/kafka-fix-stat-leak-resubmit
Create consumers for Kafka tables on fly with TTL (resubmit)
2023-12-30 13:03:16 +01:00
Alexey Milovidov
e1812f3b58
Merge pull request #58266 from ClickHouse/vdimir/simple_fix_tuple_elimination
Analyzer: fix tuple comparison when result is always null
2023-12-30 13:02:38 +01:00
Alexey Milovidov
aa6ecd2d59
Merge pull request #58343 from azat/s3/optional-gcs-compose
Avoid sending ComposeObject requests after upload to GCS
2023-12-30 12:40:04 +01:00
Alexey Milovidov
40ca9c202d
Merge pull request #58346 from ClickHouse/check-what-would-be-ifremove-array-joined-columns-from-key-condition
Check what happen if remove array joined columns from KeyCondition
2023-12-30 12:38:57 +01:00
Alexey Milovidov
f058394d92
Merge pull request #58351 from ClickHouse/fix_00002
Keep exception format string in retries ctl
2023-12-30 12:37:36 +01:00
Alexey Milovidov
39b239683c Attach all system tables in clickhouse-local 2023-12-29 21:25:22 +01:00
Nikolai Kochetov
b95bdef09e Update StorageS3 and StorageS3Cluster 2023-12-29 17:41:11 +00:00
Kruglov Pavel
f57939096c
Merge branch 'master' into ignore-mv-with-dropped-target-table 2023-12-29 17:02:23 +01:00
Nikolai Kochetov
5521e5d9b1 Refactor StorageHDFS and StorageFile virtual columns filtering 2023-12-29 15:58:01 +00:00
robot-ch-test-poll3
07ba672e37
Merge pull request #58142 from canhld94/final_less_compare
MergeTree FINAL to not compare rows from same non-L0 part
2023-12-29 16:47:14 +01:00
Azat Khuzhin
a12df35be4 Eliminate possible race between ALTER_METADATA and MERGE_PARTS
v2: move metadata version check after checking that the part is not covering part
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2023-12-29 16:46:10 +01:00
Azat Khuzhin
c7fa93d704 Add infrastructure for testing replicated MergeTree queue
- replicated_queue_fail_next_entry - to fail next queue entry
- replicated_queue_unfail_entries - to "unfail" all queue entries (if
  any)

Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2023-12-29 16:43:01 +01:00
Alexander Tokmakov
1013f6b23f
Merge branch 'master' into reintroduce_is_deleted 2023-12-29 15:46:24 +01:00
Alexander Tokmakov
72a0797b88 keep exception format string in retries ctl 2023-12-29 15:21:46 +01:00
Alexey Milovidov
ea03cc82aa
Merge pull request #58320 from ClickHouse/mv3
Refreshable materialized views again
2023-12-29 14:44:50 +01:00
Azat Khuzhin
853fdfe775 Clean cached messages on destroy kafka consumer
The callchain of the kafka consumer is very tricky, so for the sake of
common sense let's just clean the messages on moving out consumer (and
in dtor, but this is just to keep that two code path in sync).

(Also reported by @filimonov)

Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2023-12-29 14:30:21 +01:00
Azat Khuzhin
b3d6caf37f Unsubscribe kafka consumer before cleaning it by TTL
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2023-12-29 14:03:53 +01:00
Nikolai Kochetov
0e8232a8c3 Check what happen if remove array joined columns from KeyCondition 2023-12-29 12:24:19 +00:00
Azat Khuzhin
f578541ded Fix destructing kafka consumer via member orders
We've discussed this with @filimonov and he pointed out that everything
else (except for rdkafka_stat/rdkafka_stat_mutex) is done via members
orders, so let's do it in the same style.

Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2023-12-29 13:19:11 +01:00
Azat Khuzhin
8c54380d80 Avoid sending ComposeObject requests after upload to GCS
This should not be required anymore, but leave it as an option, since
likely this is required for old files.

Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2023-12-29 11:53:49 +01:00
Azat Khuzhin
f4a7789cd4 Convert various S3::Client settings into separate ClientSettings struct
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2023-12-29 11:53:49 +01:00
Duc Canh Le
91a87d6b6c better implementation
Signed-off-by: Duc Canh Le <duccanh.le@ahrefs.com>
2023-12-29 07:27:10 +00:00
Igor Nikonov
208a9193f6 Merge remote-tracking branch 'origin/master' into pr-custom-key-failover 2023-12-28 21:28:36 +00:00
Alexander Tokmakov
852f397a97 fix lost blobs after dropping a replica with broken detached parts 2023-12-28 21:47:19 +01:00
Kruglov Pavel
fbd3f7cd59
Merge pull request #56132 from Avogar/flatten-only-true-nested
Flatten only true Nested type if flatten_nested=1, not all Array(Tuple)
2023-12-28 20:58:28 +01:00
Michael Kolupaev
c4f4516a37 Fix WriteBuffer assert if refresh is cancelled at the wrong moment 2023-12-28 18:34:28 +00:00
Nikolai Kochetov
490a8bce9e Remove commented code. 2023-12-28 18:01:08 +00:00
Michael Kolupaev
ea138fe8c9 space 2023-12-28 17:56:06 +00:00
Michael Kolupaev
96c68e5aae Remove pausing, enable multithreading, kick off refresh on table creation unless the query says EMPTY 2023-12-28 17:56:06 +00:00
Michael Kolupaev
4d732cdf1e Add to system.process, improve test slightly 2023-12-28 17:56:05 +00:00
Michael Kolupaev
f0417d0ec3 Things 2023-12-28 17:56:05 +00:00
Michael Kolupaev
0fc7535eba Fixes 2023-12-28 17:56:05 +00:00
Michael Kolupaev
609b2c216c Fix some of the CI 2023-12-28 17:56:05 +00:00
Michael Kolupaev
8b8ef41407 Documentation 2023-12-28 17:56:05 +00:00
Michael Kolupaev
64e6deb197 Slightly more things 2023-12-28 17:56:05 +00:00
Michael Kolupaev
dda0606f67 Things 2023-12-28 17:56:05 +00:00
Michael Kolupaev
98dbd105ad Overhaul timestamp arithmetic 2023-12-28 17:56:04 +00:00
Michael Kolupaev
a524e8c51e Overhaul dependencies 2023-12-28 17:56:04 +00:00
Michael Kolupaev
bd18522cad Overhaul RefreshTask 2023-12-28 17:56:04 +00:00
Michael Kolupaev
29a8edb40e Simple review comments 2023-12-28 17:56:04 +00:00
koloshmet
49367186e3 fix fix fix 2023-12-28 17:56:04 +00:00
koloshmet
fb420a160b proper tmp table cleanup 2023-12-28 17:56:04 +00:00
koloshmet
0999a6d98e proper tmp table cleanup 2023-12-28 17:56:04 +00:00
koloshmet
238741dafe fixed style 2023-12-28 17:56:04 +00:00
koloshmet
c52aa984ee refreshable materialized views 2023-12-28 17:56:04 +00:00
Nikolai Kochetov
4c68716df7 Fix another test. 2023-12-28 17:51:11 +00:00
Nikolai Kochetov
d7a473e386 Fix some test. 2023-12-28 17:34:28 +00:00
avogar
e66701dd10 Add setting ignore_materialized_views_with_dropped_target_table 2023-12-28 15:00:39 +00:00
Nikolai Kochetov
50e9c9bb4e Fixing tests. 2023-12-28 14:59:33 +00:00
Azat Khuzhin
ecf7188d52 Fix use-after-free in KafkaConsumer due to statistics callback
CI founds [1]:

    Exception: Sanitizer assert found for instance �=================================================================
    ==1==ERROR: AddressSanitizer: heap-use-after-free on address 0x5250006a4100 at pc 0x55d4ed46d2e2 bp 0x7f7e33b40190 sp 0x7f7e33b3f950
    WRITE of size 5390 at 0x5250006a4100 thread T2 (TCPHandler)
       8 0x55d50eba9497 in DB::KafkaConsumer::setRDKafkaStat(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&) build_docker/./src/Storages/Kafka/KafkaConsumer.h:117:22
       12 0x55d51e0eebfe in cppkafka::stats_callback_proxy(rd_kafka_s*, char*, unsigned long, void*) build_docker/./contrib/cppkafka/src/configuration.cpp:92:5
       13 0x55d51e151e3d in rd_kafka_poll_cb build_docker/./contrib/librdkafka/src/rdkafka.c:3790:7
       14 0x55d51e15531b in rd_kafka_consumer_close build_docker/./contrib/librdkafka/src/rdkafka.c:3200:31
       15 0x55d51e0f3241 in cppkafka::Consumer::close() build_docker/./contrib/cppkafka/src/consumer.cpp:293:33
       16 0x55d51e0f3241 in cppkafka::Consumer::~Consumer() build_docker/./contrib/cppkafka/src/consumer.cpp:82:9
       20 0x55d50eb8d12e in DB::KafkaConsumer::~KafkaConsumer() build_docker/./src/Storages/Kafka/KafkaConsumer.cpp:179:1

    0x5250006a4100 is located 0 bytes inside of 8736-byte region [0x5250006a4100,0x5250006a6320)
    freed by thread T2 (TCPHandler) here:
       0 0x55d4ed4a26b2 in operator delete(void*, unsigned long) (/usr/bin/clickhouse+0xa94b6b2) (BuildId: 74ec4a14a5109c41de109e82d56d8d863845144d)
       1 0x55d50eb8ca55 in void std::__1::__libcpp_operator_delete[abi:v15000]<void*, unsigned long>(void*, unsigned long) build_docker/./contrib/llvm-project/libcxx/include/new:256:3
       2 0x55d50eb8ca55 in void std::__1::__do_deallocate_handle_size[abi:v15000]<>(void*, unsigned long) build_docker/./contrib/llvm-project/libcxx/include/new:282:10
       3 0x55d50eb8ca55 in std::__1::__libcpp_deallocate[abi:v15000](void*, unsigned long, unsigned long) build_docker/./contrib/llvm-project/libcxx/include/new:296:14
       4 0x55d50eb8ca55 in std::__1::allocator<char>::deallocate[abi:v15000](char*, unsigned long) build_docker/./contrib/llvm-project/libcxx/include/__memory/allocator.h:128:13
       5 0x55d50eb8ca55 in std::__1::allocator_traits<std::__1::allocator<char>>::deallocate[abi:v15000](std::__1::allocator<char>&, char*, unsigned long) build_docker/./contrib/llvm-project/libcxx/include/__memory/allocator_traits.h:282:13
       6 0x55d50eb8ca55 in std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>::~basic_string() build_docker/./contrib/llvm-project/libcxx/include/string:2334:9
       7 0x55d50eb8ca55 in DB::KafkaConsumer::~KafkaConsumer() build_docker/./src/Storages/Kafka/KafkaConsumer.cpp:179:1

  [1]: https://s3.amazonaws.com/clickhouse-test-reports/0/745d9bb47f3425e28e5660ed7c730038ffece4ee/integration_tests__asan__analyzer__%5B6_6%5D/integration_run_parallel4_0.log

Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2023-12-28 15:48:43 +01:00
Azat Khuzhin
4a14112af1 Move StorageKafka::createConsumer() into KafkaConsumer
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
(cherry picked from commit ebad1bf4f3)
2023-12-28 15:32:39 +01:00
Azat Khuzhin
87f3f6619a Fix data-race between StorageKafka::startup() and cleanConsumers()
Actually now we can create consumer object in the ctor, no need to do
this in startup(), since consumer now do not connects to kafka.

Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
(cherry picked from commit 03218202d3)
2023-12-28 15:32:39 +01:00
Azat Khuzhin
3c139d7135 Update comment for statistics.interval.ms librdkafka option
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
(cherry picked from commit 1f03a21033)
2023-12-28 15:32:39 +01:00
Azat Khuzhin
6f85306510 Use separate thread for kafka consumers cleanup
Since pool may exceed threads, while we need to run this thread always
to avoid memory leaking.

And this should not be a problem since librdkafka has multiple threads
for each consumer (5!) anyway.

Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
(cherry picked from commit 06a9e9a9ca)
2023-12-28 15:32:39 +01:00
Azat Khuzhin
7d2b82c37c Add ability to configure TTL for kafka consumers
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
(cherry picked from commit b19b70b8fc)
2023-12-28 15:32:39 +01:00
Azat Khuzhin
bea1610219 Preserve KafkaConsumer objects
This will make system.kafka_consumers more useful, since after TTL
consumer object will be removed prio this patch, but after, all
information will be preserved.

Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
(cherry picked from commit 2ff0bfb0a1)
2023-12-28 15:32:39 +01:00
Azat Khuzhin
71fdde76c2 Enable stats for system.kafka_consumers back by default
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
(cherry picked from commit db74549940)
2023-12-28 15:32:39 +01:00
Azat Khuzhin
d66be02dc3 Create consumers for Kafka tables on fly (but keep them for 1min since last used)
Pool of consumers created a problem for librdkafka internal statistics,
you need to read from the queue always, while in ClickHouse consumers
created regardless are there any readers or not (attached materialized
views or direct SELECTs).

Otherwise, this statistics messages got queued and never released,
which:
- creates live memory leak
- and also makes destroy very slow, due to librdkafka internals (it
  moves entries from this queue into another linked list, but in a
  with sorting, which is incredibly slow for linked lists)

So the idea is simple, let's create a pool of consumers only when they
are required, and destroy them after some timeout (right now it is 60
seconds) if nobody uses them, that way this problem should gone.

This should also reduce number of internal librdkafka threads, when
nobody reads from Kafka tables.

Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
(cherry picked from commit e7592c140e)
2023-12-28 15:32:39 +01:00
Azat Khuzhin
a6841c8915 Properly set shutdown_called in StorageKafka::shutdown()
Fixes: https://github.com/ClickHouse/ClickHouse/pull/42777
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
(cherry picked from commit 51d4f583e6)
2023-12-28 15:32:39 +01:00
Azat Khuzhin
3541d9a05f Remove StorageKafka::num_created_consumers (in favor of all_consumers.size())
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
(cherry picked from commit 123d63e824)
2023-12-28 15:32:39 +01:00
avogar
e1a9baa5b0 Fix 2023-12-28 13:51:37 +00:00
Nikolai Kochetov
737563296b
Merge branch 'master' into filter-virtual-columns-storage-merge 2023-12-28 14:47:41 +01:00
Alexander Tokmakov
bdada351c8 Revert "Merge pull request #58274 from ClickHouse/revert-58267"
This reverts commit 583b9637c2, reversing
changes made to 224e937620.
2023-12-28 14:07:59 +01:00
Alexander Tokmakov
5fcbf9cfb0 Revert "Merge pull request #58251 from ClickHouse/reintroduce-compatibility-with-a-misfeature"
This reverts commit a811d5b761, reversing
changes made to 583b9637c2.
2023-12-28 14:06:56 +01:00
kssenii
3d2e95dbf5 Fix build 2023-12-28 13:49:49 +01:00
kssenii
234e13ac7e Merge remote-tracking branch 'origin' into broken-projections-better-handling 2023-12-28 13:44:04 +01:00
Alexander Tokmakov
38fe70c68a
Revert "Refreshable materialized views (takeover)" 2023-12-28 13:12:20 +01:00
Duc Canh Le
238c5e66d5 use ChunkInfo to carry part level
Signed-off-by: Duc Canh Le <duccanh.le@ahrefs.com>
2023-12-28 11:01:18 +00:00
Alexey Milovidov
4bb8592434 Update autogenerated version to 23.13.1.1 and contributors 2023-12-28 11:22:16 +01:00
凌涛
4bd6cb9cc9 Inverted Index support function match 2023-12-28 17:49:43 +08:00
Alexey Milovidov
524d53199d
Merge branch 'master' into mv 2023-12-28 04:11:48 +01:00
Alexey Milovidov
a811d5b761
Merge pull request #58251 from ClickHouse/reintroduce-compatibility-with-a-misfeature
Reintroduce compatibility with `is_deleted` on a syntax level
2023-12-28 04:11:04 +01:00
Alexey Milovidov
c7efd2afea Revert #58267 2023-12-28 04:09:33 +01:00
Alexey Milovidov
40a5dbdeba
Merge branch 'master' into mv 2023-12-28 03:16:27 +01:00
Alexey Milovidov
c52886eb81
Revert "Create consumers for Kafka tables on fly (but keep them for some period since last used)" 2023-12-28 03:35:57 +03:00
Alexey Milovidov
1d9dbfd18b
Merge pull request #49103 from ClickHouse/check-about-global-sorting
Fixed a sorting order breakage in TTL GROUP BY
2023-12-28 01:35:14 +01:00
Alexey Milovidov
d7a35773c1
Merge pull request #58252 from Algunenano/i51543
Avoid throwing ABORTED on normal situations
2023-12-28 00:28:51 +01:00
Alexey Milovidov
8d984df135
Merge pull request #58237 from azat/build/fwd-decl-exception
Some code refactoring (was an attempt to improve build time, but failed)
2023-12-28 00:21:09 +01:00
Alexey Milovidov
c024dc9c3d
Merge pull request #58265 from ClickHouse/remove-mayBenefitFromIndexForIn
Remove mayBenefitFromIndexForIn
2023-12-28 00:15:04 +01:00
Alexey Milovidov
dcbd3b9c26
Merge pull request #58267 from ClickHouse/fix_is_deleted_compatibility
Re-introduce `is_deleted` column for ReplacingMergeTree
2023-12-28 00:13:01 +01:00
Michael Kolupaev
4d4d8e0545 space 2023-12-27 20:25:35 +00:00
Michael Kolupaev
b9cbecb0df Remove pausing, enable multithreading, kick off refresh on table creation unless the query says EMPTY 2023-12-27 20:24:56 +00:00
Michael Kolupaev
de8567660c Add to system.process, improve test slightly 2023-12-27 20:24:55 +00:00
Michael Kolupaev
538b23d862 Things 2023-12-27 20:24:55 +00:00
Michael Kolupaev
802961f0a2 Fixes 2023-12-27 20:24:55 +00:00
Michael Kolupaev
673743e2ac Fix some of the CI 2023-12-27 20:24:55 +00:00
Michael Kolupaev
7786b12a89 Documentation 2023-12-27 20:24:55 +00:00
Michael Kolupaev
418423a304 Slightly more things 2023-12-27 20:24:55 +00:00
Michael Kolupaev
ef4cc5ec7f Things 2023-12-27 20:24:55 +00:00
Michael Kolupaev
a7c369e14f Overhaul timestamp arithmetic 2023-12-27 20:24:55 +00:00
Michael Kolupaev
01369a0a8a Overhaul dependencies 2023-12-27 20:24:54 +00:00
Michael Kolupaev
01345981e2 Overhaul RefreshTask 2023-12-27 20:24:54 +00:00
Michael Kolupaev
5dc04a13a7 Simple review comments 2023-12-27 20:24:54 +00:00
koloshmet
808cb0fa05 fix fix fix 2023-12-27 20:24:54 +00:00
koloshmet
f1161566b4 proper tmp table cleanup 2023-12-27 20:24:54 +00:00
koloshmet
f14114dafc proper tmp table cleanup 2023-12-27 20:24:54 +00:00
koloshmet
d1932763f3 fixed style 2023-12-27 20:24:54 +00:00
koloshmet
c762898adb refreshable materialized views 2023-12-27 20:24:54 +00:00
Alexander Tokmakov
a3cba8e06f
Update StorageReplicatedMergeTree.cpp 2023-12-27 20:27:15 +01:00
Alexander Tokmakov
f5bcfaffa5 disable vertical merges with cleanup 2023-12-27 19:28:50 +01:00
vdimir
1137461aaf
Analyzer: fix tuple comparison when result is always null 2023-12-27 18:19:39 +00:00
Nikolai Kochetov
e493789bf3 Remove from indexes as well. 2023-12-27 17:51:23 +00:00
Nikolai Kochetov
bcd34b25b2 Remove mayBenefitFromIndexForIn 2023-12-27 17:42:40 +00:00
Nikolai Kochetov
9f9b080b00
Update StorageMerge.cpp 2023-12-27 18:33:00 +01:00
Alexander Tokmakov
f924848347 partially revert #54368 (f28ad1e136) 2023-12-27 18:17:59 +01:00
Raúl Marín
dfe7b0e973 Keep message 2023-12-27 18:13:22 +01:00
Nikolai Kochetov
2f50d3da50 Filter virtual columns for StorageMerge from plan filter condition. 2023-12-27 17:05:23 +00:00
Raúl Marín
5f183649b2 Avoid throwing ABORTED on normal situations 2023-12-27 17:44:46 +01:00
Alexey Milovidov
64b4e1a66f Reintroduce compatibility with is_deleted on a syntax level 2023-12-27 17:42:51 +01:00
Nikolai Kochetov
3ec1b2a852 Refactor StorageMerge. 2023-12-27 16:32:21 +00:00
avogar
9ef8de21b2 Read column once while reading more that one subcolumn from it in Compact parts 2023-12-27 16:30:04 +00:00
Nikita Mikhaylov
3dbd3b3e61 Better 2023-12-27 15:50:20 +00:00
Nikita Mikhaylov
b60109d43e Better 2023-12-27 15:50:20 +00:00
Alexey Milovidov
f00337e2ba
Merge pull request #57872 from CurtizJ/optimize-aggregation-consecutive-keys
Better optimization of consecutive keys in aggregation
2023-12-27 15:44:22 +01:00
Azat Khuzhin
b9233f6d4f Move Allocator code into module part
This should reduce amount of code that should be recompiled on
Exception.h changes (and everything else that had been included there).

This will actually not help a lot, because it is also included into
PODArray.h and ThreadPool.h at least... Sigh.

Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2023-12-27 15:42:08 +01:00
Alexander Tokmakov
01d042c490 Revert "Merge pull request #57932 from ClickHouse/remove-shit-cleanup"
This reverts commit 2d58dc512c, reversing
changes made to 41873dc4a3.
2023-12-27 13:46:06 +01:00
Alexander Tokmakov
eeadeaa89d Revert "Merge pull request #58104 from ClickHouse/cleanup-replication-compatibility"
This reverts commit 34fd555ee6, reversing
changes made to cb53ee63be.
2023-12-27 13:03:38 +01:00
Azat Khuzhin
ebad1bf4f3 Move StorageKafka::createConsumer() into KafkaConsumer
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2023-12-27 09:49:07 +01:00
Azat Khuzhin
03218202d3 Fix data-race between StorageKafka::startup() and cleanConsumers()
Actually now we can create consumer object in the ctor, no need to do
this in startup(), since consumer now do not connects to kafka.

Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2023-12-27 09:49:07 +01:00
Azat Khuzhin
1f03a21033 Update comment for statistics.interval.ms librdkafka option
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2023-12-27 09:49:07 +01:00
Azat Khuzhin
06a9e9a9ca Use separate thread for kafka consumers cleanup
Since pool may exceed threads, while we need to run this thread always
to avoid memory leaking.

And this should not be a problem since librdkafka has multiple threads
for each consumer (5!) anyway.

Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2023-12-27 09:49:07 +01:00
Azat Khuzhin
b19b70b8fc Add ability to configure TTL for kafka consumers
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2023-12-27 09:49:07 +01:00
Azat Khuzhin
2ff0bfb0a1 Preserve KafkaConsumer objects
This will make system.kafka_consumers more useful, since after TTL
consumer object will be removed prio this patch, but after, all
information will be preserved.

Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2023-12-27 09:49:07 +01:00
Azat Khuzhin
db74549940 Enable stats for system.kafka_consumers back by default
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2023-12-27 09:49:07 +01:00
Azat Khuzhin
e7592c140e Create consumers for Kafka tables on fly (but keep them for 1min since last used)
Pool of consumers created a problem for librdkafka internal statistics,
you need to read from the queue always, while in ClickHouse consumers
created regardless are there any readers or not (attached materialized
views or direct SELECTs).

Otherwise, this statistics messages got queued and never released,
which:
- creates live memory leak
- and also makes destroy very slow, due to librdkafka internals (it
  moves entries from this queue into another linked list, but in a
  with sorting, which is incredibly slow for linked lists)

So the idea is simple, let's create a pool of consumers only when they
are required, and destroy them after some timeout (right now it is 60
seconds) if nobody uses them, that way this problem should gone.

This should also reduce number of internal librdkafka threads, when
nobody reads from Kafka tables.

Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2023-12-27 09:49:07 +01:00
Azat Khuzhin
51d4f583e6 Properly set shutdown_called in StorageKafka::shutdown()
Fixes: https://github.com/ClickHouse/ClickHouse/pull/42777
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2023-12-27 09:49:07 +01:00
Azat Khuzhin
123d63e824 Remove StorageKafka::num_created_consumers (in favor of all_consumers.size())
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2023-12-27 09:49:07 +01:00
Duc Canh Le
476ca4246d Merge branch 'master' into final_no_copy
Resolve conflicts + add some comments

Signed-off-by: Duc Canh Le <duccanh.le@ahrefs.com>
2023-12-27 07:00:58 +00:00