Commit Graph

5847 Commits

Author SHA1 Message Date
Kruglov Pavel
3aa795355f
Fix build 2023-05-28 15:46:32 +02:00
Kruglov Pavel
65c34e73e7
Clean 2023-05-28 15:45:40 +02:00
helifu
03e11b6e16 Remove the duplicate pair of parentheses 2023-05-28 12:59:34 +08:00
avogar
ef9bae50b9 Fix bugs in Poco, use true non-blocking IO 2023-05-26 23:11:57 +00:00
Sema Checherinda
b0eff95388 update doc, add profile event WriteBufferFromS3WaitInflightLimitMicroseconds 2023-05-26 18:59:21 +02:00
serxa
c4687a8b93 Unify priorities: rework AsyncLoader 2023-05-26 16:46:59 +00:00
Azat Khuzhin
6b5933a3db Add new profile events for queries with subqueries
Differs from SelectQuery/InsertQuery that it could be > 1 (in case of
MATERIALIZED VIEW attached to the table), since each local SELECT/INSERT
query is accounted, not only initial.

Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2023-05-26 18:28:40 +02:00
serxa
edffedbabf fix 2023-05-26 15:10:08 +00:00
Sergei Trifonov
84203341ca
Merge branch 'master' into async-loader-workloads 2023-05-26 16:17:56 +02:00
Sergei Trifonov
0d1f2e297b
Unify priorities: lower value means higher priority (#50205) 2023-05-26 15:55:30 +02:00
Sema Checherinda
9603f2b49c
Merge pull request #50190 from ClibMouse/feature/unify-core-id-querying
Implement a uniform way to query processor core IDs
2023-05-26 15:46:39 +02:00
Victor Krasnov
050b93363b Add unit tests 2023-05-26 12:25:11 +00:00
serxa
b8d3e495e5 add pool_id out-of-bound checks 2023-05-25 12:42:19 +00:00
serxa
e3ce2f834a fix style 2023-05-25 12:35:00 +00:00
Sergei Trifonov
2df22d396d
Merge branch 'master' into async-loader-workloads 2023-05-25 14:32:12 +02:00
Sergei Trifonov
78c89da8bb
Update src/Common/AsyncLoader.cpp
Co-authored-by: Antonio Andelic <antonio2368@users.noreply.github.com>
2023-05-25 13:48:03 +02:00
Sergei Trifonov
32cb9931b6
Update src/Common/AsyncLoader.h
Co-authored-by: Antonio Andelic <antonio2368@users.noreply.github.com>
2023-05-25 13:47:56 +02:00
何李夫
e4c8c4cecf
Add zookeeper name in endpoint id (#49780)
* Add zookeeper name in endpoint id

When we migrate a replicated table from one zookeeper cluster to
another (the reason why we migration is that zookeeper's load is
too high), we will create a new table with the same zpath, but it
will fail and the old table will be in trouble.

Here is some infomation:
1.old table:
  CREATE TABLE a1 (`id` UInt64)
  ENGINE = ReplicatedMergeTree('/clickhouse/tables/default/a1/{shard}', '{replica}')
  ORDER BY (id);
2.new table:
  CREATE TABLE a2 (`id` UInt64)
  ENGINE = ReplicatedMergeTree('aux1:/clickhouse/tables/default/a1/{shard}', '{replica}')
  ORDER BY (id);
3.error info:
  <Error> executeQuery: Code: 220. DB::Exception: Duplicate interserver IO endpoint:
          DataPartsExchange:/clickhouse/tables/default/a1/01/replicas/02.
          (DUPLICATE_INTERSERVER_IO_ENDPOINT)
  <Error> InterserverIOHTTPHandler: Code: 221. DB::Exception: No interserver IO endpoint
          named DataPartsExchange:/clickhouse/tables/default/a1/01/replicas/02.
          (NO_SUCH_INTERSERVER_IO_ENDPOINT)

* Revert "Add zookeeper name in endpoint id"

This reverts commit 9deb75b249619b7abdd38e3949ca8b3a76c9df8e.

* Add zookeeper name in endpoint id

When we migrate a replicated table from one zookeeper cluster to
another (the reason why we migration is that zookeeper's load is
too high), we will create a new table with the same zpath, but it
will fail and the old table will be in trouble.

* Fix incompatible with a new setting

* add a test, fix other issues

* Update 02442_auxiliary_zookeeper_endpoint_id.sql

* Update 02735_system_zookeeper_connection.reference

* Update 02735_system_zookeeper_connection.sql

* Update run.sh

* Remove the 'no-fasttest' tag

* Update 02442_auxiliary_zookeeper_endpoint_id.sql

---------

Co-authored-by: Alexander Tokmakov <tavplubix@clickhouse.com>
Co-authored-by: Alexander Tokmakov <tavplubix@gmail.com>
2023-05-25 12:50:14 +03:00
ltrk2
f76f989b53 Implement a uniform way to query processor core IDs 2023-05-24 13:33:05 +00:00
Kruglov Pavel
4689412ab3
Change fields destruction order in AsyncTaskExecutor 2023-05-23 16:14:24 +02:00
Robert Schulze
f4c73e94d2
Merge pull request #49989 from arenadata/ADQM-811
Add support of Date|Date32 arguments to the toUnixTimestamp() function
2023-05-23 08:55:56 +02:00
Victor Krasnov
07d9f33b2e Improve toFirstDayNumOfWeek infinitesimally 2023-05-23 04:01:44 +00:00
avogar
17b639c612 Make better 2023-05-22 18:22:05 +00:00
Kseniia Sumarokova
c6e4db969f
Merge pull request #50028 from kssenii/some-minor-changes
Move some common code to common
2023-05-22 18:25:24 +02:00
Sergei Trifonov
f099e3f41e
Merge pull request #50045 from azat/ddl-fix-opentelemetry
Add proper escaping for DDL OpenTelemetry context serialization
2023-05-22 18:20:17 +02:00
Nikolay Degterinsky
d4b89cb643
Merge pull request #49356 from Ziy1-Tan/vcol
Support for `_path` and `_file` virtual columns for table function `url`.
2023-05-22 18:10:32 +02:00
avogar
ea59d2ec5d Allow custom cleanup function 2023-05-22 14:06:46 +00:00
Kruglov Pavel
054ffc47b7
Merge branch 'master' into fiber-local-var-2 2023-05-22 15:17:45 +02:00
avogar
ef09ed7117 Fix assert in SpanHolder::finish() with fibers attempt 2 2023-05-22 12:35:53 +00:00
Sergei Trifonov
0f90bfdd11
Merge pull request #50051 from ClickHouse/add-more-distributed-connection-profile-events
Add more profile events for distributed connections
2023-05-22 13:37:56 +02:00
Sergei Trifonov
7fbfa4b21e
Merge branch 'master' into async-loader-workloads 2023-05-22 13:31:42 +02:00
Victor Krasnov
98aace14ae Add DATE_SECONDS_PER_DAY macro definition to replace the numeric literal 86400 2023-05-22 09:23:23 +00:00
Han Fei
a2c0a65344
Merge pull request #49919 from hanfei1991/hanfei/fix-optimize-regexp-prefix
fix `is_prefix` in OptimizeRegularExpression
2023-05-22 10:50:36 +02:00
Han Fei
a257ff6cf3 address comment 2023-05-22 10:41:22 +02:00
serxa
372601d6df fix 2023-05-21 17:04:49 +00:00
serxa
cd11c25864 fix test + more testing for dynamic prioritization 2023-05-21 17:04:00 +00:00
serxa
c5765e71f9 requeue jobs w/o allocations and spawn workers during prioritization 2023-05-21 17:02:56 +00:00
Sergei Trifonov
e33455ed87
Merge branch 'master' into async-loader-workloads 2023-05-21 16:30:58 +02:00
serxa
128b8e5889 fix tests + add test for dynamic pools 2023-05-21 14:28:16 +00:00
Robert Schulze
2a9ff30a7f
Merge pull request #49380 from azat/dict/hashed-memory
Improve memory usage and speed of SPARSE_HASHED/HASHED dictionaries
2023-05-21 15:46:41 +02:00
serxa
44b1754ccf more profile events 2023-05-21 12:43:47 +00:00
serxa
c56e6a8b80 Add more profile events for distributconnections 2023-05-21 12:15:06 +00:00
Sergei Trifonov
3c002755e2
Merge pull request #50036 from ClickHouse/fix-load-balancing
Load balancing bugfixes
2023-05-21 11:21:55 +02:00
Azat Khuzhin
82054d40a5 Add proper escaping for DDL OpenTelemetry context serialization
Before you was able to break the format by using "\n" or "\t", that will
simply lead to DDL hang, because DDLWorker will simply log the error and
do nothing more:

    <Error> DDLWorker: Cannot parse DDL task query-0000000056: Incorrect task format. Will try to send error status: Code: 27. DB::ParsingException: Cannot parse input: expected '\n' before: 'bar\n1\n'. (CANNOT_PARSE_INPUT_ASSERTION_FAILED) (version 23.5.1.1)

Fix this by adding proper escaping.

Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2023-05-20 13:15:49 +02:00
Azat Khuzhin
52c5fd5cb9 Rewrite OpenTelemetry context serialization for DDL without IO/Operators.h
This is required to switch to escaped versions.

Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2023-05-20 13:14:40 +02:00
Igor Nikonov
af80e29519
Merge branch 'master' into clearable_hash_set_without_zero_storage 2023-05-19 23:36:30 +02:00
Sergei Trifonov
14e8132ac4
Merge branch 'master' into fix-load-balancing 2023-05-19 23:05:27 +02:00
serxa
052d8aca71 limit max_tries value by max_error_cap to avoid unlimited number of retries 2023-05-19 18:13:29 +00:00
serxa
d69c35fcdd fix PoolWithFailover error_count integer overflow 2023-05-19 17:57:00 +00:00
kssenii
791bb6cd4c Fix style check 2023-05-19 17:35:01 +02:00
kssenii
0eab528f9f Move common code 2023-05-19 16:23:56 +02:00
mateng915
5237dd0245
New system table zookeeper connection (#45245)
* Feature: Support new system table to show which zookeeper node be connected

Description:
============
Currently we have no place to check which zk node be connected otherwise using
lsof command. It not convenient

Solution:
=========
Implemented a new system table, system.zookeeper_host when CK Server has zk
this table will show the zk node dir which connected by current CK server

Noted: This table can support multi-zookeeper cluster scenario.

* fixed review comments

* added test case

* update test cases

* remove unused code

* fixed review comments and removed unused code

* updated test cases for print host, port and is_expired

* modify the code comments

* fixed CI Failed

* fixed code style check failure

* updated test cases by added Tags

* update test reference

* update test cases

* added system.zookeeper_connection doc

* Update docs/en/operations/system-tables/zookeeper_connection.md

* Update docs/en/operations/system-tables/zookeeper_connection.md

* Update docs/en/operations/system-tables/zookeeper_connection.md

---------

Co-authored-by: Alexander Tokmakov <tavplubix@gmail.com>
2023-05-19 17:06:43 +03:00
Sergei Trifonov
5db5f6e44b
Merge branch 'master' into fix-throttlers 2023-05-19 14:08:36 +02:00
Azat Khuzhin
01bf041cca Rewrite HashTableGrower{,WithPrecalculation}::set w/o ternary operators
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2023-05-19 06:07:21 +02:00
Azat Khuzhin
634f168a74 Introduce max_size_degree for HashTableGrower{,WithPrecalculation}
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2023-05-19 06:07:21 +02:00
Azat Khuzhin
7eba6def94 Add a comment for HashTableGrowerWithPrecalculation about load factor
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2023-05-19 06:07:21 +02:00
Azat Khuzhin
fc19e79f50 Change coding style of declaring packed attribute in PackedHashMap
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2023-05-19 06:07:21 +02:00
Azat Khuzhin
65dd87d0da Fix "reference binding to misaligned address" in PackedHashMap
Use separate helpers that accept/return values, instead of reference,
anyway PackedHashMap is developed for small structure.

v0: fix for keys
v2: fix for values
v3: fix bitEquals
v4: fix for iterating over HashMap
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2023-05-19 06:07:21 +02:00
Azat Khuzhin
7c8d8eeb56 Use Cell::setMapped() over separate helper insertSetMapped()
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2023-05-19 06:07:21 +02:00
Azat Khuzhin
8c6d691f52 Use HashTable constructor in HashSet
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2023-05-19 06:07:21 +02:00
Azat Khuzhin
fb6f7631c2 Add ability to pass grower for HashTable during creation
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2023-05-19 06:07:21 +02:00
Azat Khuzhin
b44497fd4c Introduce PackedHashMap (HashMap with structure without padding)
In case of you have HashMap with <UInt64, UInt16> as <Key, Value> the
overhead of 38% can be crutial, especially if you have tons of keys.

Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2023-05-19 06:07:21 +02:00
Azat Khuzhin
c4f23e87f1 Export grower_type in HashTable
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2023-05-19 06:07:21 +02:00
Victor Krasnov
3a3e413552 Implement toLastDayWeek function 2023-05-18 21:47:52 +00:00
Nikita Taranov
0dd67bacf2
Merge branch 'master' into optimize_reading2 2023-05-17 15:06:41 +02:00
Azat Khuzhin
fdfb1eda55 Fix {Local,Remote}ReadThrottlerSleepMicroseconds metric values
And also update the test, since now you could have slightly less sleep
intervals, if query spend some time in other places.

But what is important is that query_duration_ms does not exceeded
calculated delay.

Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2023-05-17 12:12:39 +02:00
Igor Nikonov
7d647c50c7
Merge branch 'master' into clearable_hash_set_without_zero_storage 2023-05-17 11:29:01 +02:00
Han Fei
3ead9e627e Merge branch 'master' into hanfei/fix-optimize-regexp-prefix 2023-05-16 22:31:01 +02:00
serxa
b12eefc694 fix timeout units and log message 2023-05-16 18:57:04 +00:00
Igor Nikonov
dea5cbcf4e
Slightly update comment 2023-05-16 16:39:00 +02:00
Han Fei
ea59761809 fix OptimizeRegularExpression 2023-05-16 15:25:04 +02:00
Vitaly Baranov
c92219f01b BACKUP now writes encrypted data for tables on encrypted disks. 2023-05-16 14:26:33 +02:00
Sergei Trifonov
1f9135e4ab
Merge branch 'master' into async-loader-workloads 2023-05-16 12:50:09 +02:00
Kruglov Pavel
b414760d43
Merge pull request #49673 from Avogar/fiber-local-var
Fix assert in SpanHolder::finish() with fibers
2023-05-16 11:59:33 +02:00
serxa
e1509ca59d fix style 2023-05-16 08:23:06 +00:00
serxa
f6d7145a72 fix tests 2023-05-15 23:05:13 +00:00
serxa
e4a653b41c Multiple pools support for AsyncLoader 2023-05-15 18:49:34 +00:00
avogar
78064d0622 Better comments 2023-05-15 15:52:14 +00:00
avogar
b23afdc533 Fix build for aarch64-darwin 2023-05-15 15:48:00 +00:00
Igor Nikonov
97e1513b22
Merge branch 'master' into clearable_hash_set_without_zero_storage 2023-05-15 17:42:10 +02:00
Sergei Trifonov
8f20085d9a
Merge pull request #48923 from ClickHouse/async-loader
Add AsyncLoader with dependency tracking and runtime prioritization
2023-05-14 15:12:39 +02:00
Alexey Milovidov
5a44dc26e7 Fixes for clang-17 2023-05-13 02:57:31 +02:00
Alexey Milovidov
12be14b195
Merge pull request #49819 from azat/fix-clock
Use CLOCK_MONOTONIC_RAW over CLOCK_MONOTONIC on Linux (fixes non monotonic clock)
2023-05-13 01:06:27 +03:00
Alexey Milovidov
efc5e69aaf
Merge pull request #49833 from HarryLeeIBM/hlee-s390x-simple-agg
Fix DefaultHash64 for s390x
2023-05-13 01:00:36 +03:00
Sergei Trifonov
a30a0d80f2
Merge branch 'master' into async-loader 2023-05-12 20:17:20 +02:00
Igor Nikonov
51c69b6fbd Comments regarding zero values in clearable hash table 2023-05-12 17:36:35 +00:00
Igor Nikonov
d3c408aaf1 ClearableHashSet w/o zero storage for StringRef 2023-05-12 16:32:23 +00:00
serxa
195eafcaed fix disable test 2023-05-12 14:51:33 +00:00
HarryLeeIBM
809fdc7b16 Fix DefaultHash64 for s390x 2023-05-12 06:00:47 -07:00
serxa
5807737804 temporarily disable JobFailure test 2023-05-12 12:02:45 +00:00
Robert Schulze
b9c185af44
Merge pull request #49678 from azat/build/llvm-16
Switch to LLVM/clang 16 (16.0.3)
2023-05-12 13:47:36 +02:00
alesapin
d147cb105c
Merge pull request #49755 from CurtizJ/fix-unit-test
Fix unit test `ExceptionFromWait`
2023-05-12 13:08:48 +02:00
Nikita Taranov
536c5ac261
Merge branch 'master' into optimize_reading2 2023-05-12 12:59:32 +02:00
Robert Schulze
922420420c
Merge pull request #49300 from ClickHouse/rs/functdocs
Introduce more fields for in-source function documentation
2023-05-12 11:36:04 +02:00
Azat Khuzhin
fa2074e67b Use CLOCK_MONOTONIC_RAW over CLOCK_MONOTONIC on Linux (fixes non monotonic clock)
There is no bug in Linux, the issue that CLOCK_MONOTONIC returns values
less then previous calls likely happens due to adjtime(3) (NTP), since
CLOCK_MONOTONIC is affected by it, and I've seen lots of slight time
modifications due to NTP on the servers. And even on my desktop (I also
have NTP enabled):

    CLOCK_MONOTONIC:     189292.803 (2 days +  4h 34m 52s)
    CLOCK_MONOTONIC_RAW: 189290.016 (2 days +  4h 34m 50s)

However on Linux there is CLOCK_MONOTONIC_RAW, it is similar to
CLOCK_MONOTONIC, but does not affected by the adjtime(3).

About performance, it is the same:

    CLOCK_MONOTONIC 10e6:     real=0m0.191s user=0m0.190s sys=0m0.000s
    CLOCK_MONOTONIC_RAW 10e6: real=0m0.191s user=0m0.191s sys=0m0.000s

Ops/s:
- AMD Threadripper: 52.3e6
- Xeon Silver 4216 2.10: 46.5e6

Fixes: c5d631ca54
Fixes: #29811 (cc @tavplubix)
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2023-05-12 10:59:53 +02:00
Anton Popov
292cfe12af
Merge branch 'master' into fix-unit-test 2023-05-11 16:56:21 +02:00
Anton Popov
db52652337 fix unit test 2023-05-10 21:00:56 +00:00
Robert Schulze
9795d5403f
Merge branch 'master' into rs/msan-randomStringUTF8 2023-05-10 20:16:49 +02:00
Robert Schulze
374dbd9c39
Fix msan issue in randomStringUTF8(<uneven number>) 2023-05-10 17:49:23 +00:00
Kruglov Pavel
289af626ad
Merge branch 'master' into fiber-local-var 2023-05-10 18:21:46 +02:00