Commit Graph

614 Commits

Author SHA1 Message Date
Alexander Gololobov
fdfee8e905 Fix printing OpNum that are not in default magic_enum range 2024-04-09 18:18:27 +02:00
Alexander Gololobov
4895a7de77 Fix format strings 2024-04-09 18:17:08 +02:00
Raúl Marín
c35a436435 Remove nested dependency on DateLutImpl 2024-04-02 14:45:48 +02:00
Alexey Milovidov
264b847f1a Fix build 2024-03-25 03:38:47 +01:00
Alexey Milovidov
4813014710 Merge with master 2024-03-25 03:38:47 +01:00
Alexey Milovidov
3a5ed40eaa Merge with master 2024-03-25 03:38:47 +01:00
Alexey Milovidov
29d51d71b7 Fix the name 2024-03-25 03:38:47 +01:00
Duc Canh Le
271342a871 change column name from duration_ms to duration_us in system.zookeeper
Signed-off-by: Duc Canh Le <duccanh.le@ahrefs.com>
2024-03-25 03:38:46 +01:00
Robert Schulze
c17536c3b3
Enable clang-tidy in headers 2024-03-18 08:00:09 +00:00
Robert Schulze
e5e84419af
Fix clang-tidy-s 2024-03-11 10:58:54 +00:00
Antonio Andelic
381c075391 Throw on query timeout 2024-03-06 13:19:40 +01:00
Alexey Milovidov
c411149364 Merge branch 'master' into sync-with-private-2 2024-03-03 04:42:14 +01:00
Robert Schulze
4ee1aa8c7c
Fixing more headers 2024-02-29 15:40:30 +00:00
Robert Schulze
a1c164a758
Fix a bunch of clang-tidy warnings in headers 2024-02-28 23:43:12 +00:00
Alexey Milovidov
763bd22725 Synchronize metrics and Keeper 2024-02-28 23:43:03 +01:00
Alexander Tokmakov
4b11735680 fix auxiliary zookeepers 2024-02-20 22:41:49 +01:00
Alexander Tokmakov
5d07c79da8
Update ZooKeeper.cpp 2024-02-19 14:37:35 +01:00
Alexander Tokmakov
b2f795ccdf fix 2024-02-16 17:59:42 +01:00
Alexander Tokmakov
228a29b93f fix 2024-02-16 14:05:22 +01:00
Alexander Tokmakov
22c97be2a4 ability to detect undead ZooKeeper sessions 2024-02-15 22:17:31 +01:00
Alexander Tokmakov
328359dcd3
Update ZooKeeperImpl.cpp 2024-02-07 18:51:19 +01:00
Alexander Gololobov
c348c4e828 Move ZooKeeperRetries.h to Common 2024-01-30 19:02:17 +01:00
Maksim Kita
2a327107b6 Updated implementation 2024-01-25 14:31:49 +03: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
Azat Khuzhin
435e1de7b0 Remove Exception's ctor to create it from a simple string-like object
This may cause troubles, like forgetting to pass arguments, and there
are few places in the code (see the upcomming patch).

I doubt that this will make any performance changes, since the check
should be compile time.

And anyway Exception is an exceptional situation which should be rare
(there is no such code with single argument for logging, while logging
is more common).

Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2023-12-24 21:26:31 +01:00
Raúl Marín
a581450567 Cosmetic 2023-12-20 18:44:09 +01:00
Raúl Marín
546484d46b Merge remote-tracking branch 'blessed/master' into backup_1 2023-12-14 19:03:59 +01:00
Nikita Mikhaylov
a0af0392cd
Random changes in random files (#57642) 2023-12-14 12:47:11 +01:00
Raúl Marín
e1965bb6b5 WIP: Remove UNCERTAIN_COMMIT in INSERT 2023-12-11 17:27:56 +01:00
Raúl Marín
a55a0c068e Merge remote-tracking branch 'blessed/master' into backup_1 2023-12-11 15:27:21 +01:00
Mikhail Koviazin
bef3fff731
Add support for read-only mode in ZooKeeper
This commit enables the read-only flag when connecting to the ZooKeeper server.

This flag is enabled by sending one extra byte when connecting,
and then receiving one extra byte during the first response.

In addition to that, we modify createIfNotExists to not complain
about attempting to alter a read-only ZooKeeper cluster if the node
already exists.

This makes ClickHouse more useful in the event of a loss of quorum,
user credentials are still accessible, which makes it possible to
connect to the cluster and run read queries.

Any DDL or DML query on a Distributed database or ReplicatedMergeTree
table will correctly fail, since it needs to write to ZooKeeper to
execute the query.

Any non-distributed query will be possible, which is ok since the
query was never replicated in the first place, there is no loss of
consistency.

Fixes #53749 as it seems to be the only thing 3.9 enforced.
2023-12-04 16:47:12 +02:00
Raúl Marín
2539100afb Review improvements 2023-11-24 16:21:56 +01:00
Raúl Marín
16ad3ef38b Fix bug in exists() 2023-11-22 09:32:12 +01:00
Raúl Marín
820c1a54c7 Tidy 2023-11-21 20:33:35 +01:00
Raúl Marín
04f966c471 Recover special handling of ephemeral nodes in ZooKeeperWithFaultInjection 2023-11-20 22:17:34 +01:00
Raúl Marín
8217915064 Replace part_committed_locally_but_zookeeper with retries 2023-11-20 13:55:50 +01:00
Raúl Marín
aadb786b2b Merge remote-tracking branch 'blessed/master' into backup_1 2023-11-20 10:53:31 +01:00
Antonio Andelic
274f2c71f2
Merge pull request #56460 from ClickHouse/keeper-map-backup-restore
Backup/Restore for KeeperMap tables
2023-11-18 19:27:36 +01:00
Raúl Marín
40175f219f Style and fix log level 2023-11-17 14:50:22 +01:00
Raúl Marín
9154e2f879 Style 2023-11-17 13:13:07 +01:00
Raúl Marín
3633e77a37 Refactor ZooKeeperWithFaultInjection 2023-11-17 12:57:32 +01:00
Alexander Gololobov
45b6956601 Fix race on zk_log 2023-11-17 12:42:06 +01:00
Antonio Andelic
9bcedf3764 Cleanup 2023-11-17 10:27:19 +00:00
Raúl Marín
cb9c973a6d WIP: Move implementation 2023-11-16 20:46:45 +01:00
Raúl Marín
19931fee67 Prepare the introduction of more keeper faults 2023-11-16 15:46:39 +01:00
Antonio Andelic
59480205d4 Merge branch 'master' into keeper-map-backup-restore 2023-11-13 12:21:26 +00:00
Robert Schulze
3f49e1c5ed
Merge remote-tracking branch 'rschu1ze/master' into pcg 2023-11-12 11:43:19 +00:00
Antonio Andelic
5fea9f9dc6 Small fixes 2023-11-10 09:27:26 +00:00
Antonio Andelic
f9895ab37b Small fixes and add test 2023-11-09 15:56:57 +00:00
Smita Kulkarni
9a9efdcf7d Updated compression to LZ4 as its better in performance 2023-11-09 10:10:22 +01:00
Robert Schulze
e46dbcb2f1
Use pcg/randomSeed() random generator/seed instead of std::mt19937/std::random_device 2023-11-07 18:54:50 +00:00
Smita Kulkarni
3d5f7a65a8 Updated protocol_version and keeper-bench 2023-11-06 15:00:56 +01:00
Smita Kulkarni
a716e12ec0 Addressed review comments 2023-11-02 14:52:10 +01:00
Smita Kulkarni
374545f4e2 Removed unwanted flush & updated to use optional for buffers 2023-11-02 09:38:53 +01:00
Smita Kulkarni
942bf7f147 Uncommented feature flag code 2023-11-01 14:41:44 +01:00
Smita Kulkarni
3361c5d973 Updated using read write buffer into modules 2023-11-01 12:05:41 +01:00
Alexey Milovidov
753ea3ab88 Fix unit test 2023-10-28 20:04:10 +02:00
Smita Kulkarni
960927a323 Updated name to use_compression 2023-10-27 14:53:54 +02:00
Smita Kulkarni
f6cc0d6652 Fixed style 2023-10-26 17:35:16 +02:00
Smita Kulkarni
ede91f42e6 Addressed review comments 2023-10-23 16:42:08 +02:00
Smita Kulkarni
c98782bd2b Merge branch 'master' into 49507_Support_compression_for_keeper_protocol 2023-10-20 14:47:17 +02:00
helifu
57d60dc4f2
Add a new column xid for zookeeper_connection (#50702)
* Refactor the code

* Add a new column xid for zookeeper_connection

* Support hostnames in the configuration

* Fix a typo

* Fix a typo

* Fix a typo

* Fix a bug about connect_time

* Update test case

* Update test case

* Fix a special build check error

* Resolve conflicts caused by rebase.

* Update failed test case

* Refactor the code according to comment

* Fix two compilation errors
2023-10-20 11:38:44 +02:00
Smita Kulkarni
af5349f76b Merge branch 'master' into 49507_Support_compression_for_keeper_protocol 2023-10-19 12:03:40 +02:00
Smita Kulkarni
e90f3f0323 Fix build 2023-10-17 12:30:11 +02:00
Smita Kulkarni
dc0a5b6f56 Fixed build issue with clang-tidy 2023-10-17 10:16:07 +02:00
Kseniia Sumarokova
96c518be5b
Merge branch 'master' into s3-queue-fixes 2023-10-16 22:19:13 +02:00
Smita Kulkarni
7b426e7cae Removed unwanted links 2023-10-15 21:56:34 +02:00
Smita Kulkarni
43cec3d8a3 Added clickhouse_parsers to other builds with compression 2023-10-15 11:35:01 +02:00
Smita Kulkarni
19163497b7 Added clickhouse-parsers to clickhouse_common_zookeeper 2023-10-15 10:15:03 +02:00
Smita Kulkarni
13ffebf559 Merge branch 'master' into 49507_Support_compression_for_keeper_protocol 2023-10-14 20:08:49 +02:00
Smita Kulkarni
0c68f1b453 Removed unwanted includes 2023-10-14 18:26:57 +02:00
Smita Kulkarni
c15b85074f Updated to include compression in clickhouse_common_io 2023-10-13 20:23:46 +02:00
kssenii
d64b990712 Merge remote-tracking branch 'origin/master' into s3-queue-fixes 2023-10-13 12:13:56 +02:00
Smita Kulkarni
16bdd31cee Included to use compression lib in utils & zookeeper tests 2023-10-13 10:38:18 +02:00
Smita Kulkarni
4cb4a46adc Added clickhouse-parser to fix clang-tidy 2023-10-12 17:03:06 +02:00
Smita Kulkarni
8b54172983 Merge branch 'master' into 49507_Support_compression_for_keeper_protocol 2023-10-12 12:32:43 +02:00
kssenii
6b191a1afe Better 2023-09-27 14:54:31 +02:00
JackyWoo
5da03e8ba5 Add load balancing test_hostname_levenshtein_distance 2023-09-27 10:46:39 +08:00
Antonio Andelic
e7c8363f6f
Merge pull request #48855 from ClickHouse/keeper-operation-create-if-not-exists
Implement `createIfNotExists` in Keeper natively
2023-09-26 16:04:51 +02:00
Smita Kulkarni
c11aa4515b Merge branch 'master' into 49507_Support_compression_for_keeper_protocol 2023-09-24 11:52:57 +02:00
Smita Kulkarni
ca07275143 Support compression for keeper protocol 2023-09-24 11:38:08 +02:00
Alexander Tokmakov
4c904a5cb0 fix 2023-09-21 00:00:21 +02:00
Alexander Tokmakov
ec80068611 add a test for no such key 2023-09-20 22:37:24 +02:00
Antonio Andelic
b65b1ee97b Merge branch 'master' into keeper-operation-create-if-not-exists 2023-09-20 13:56:36 +00:00
Antonio Andelic
69333912d5 Merge branch 'master' into keeper-operation-create-if-not-exists 2023-09-18 10:57:11 +00:00
Azat Khuzhin
5d3e3113b2 Fix possible CANNOT_READ_ALL_DATA exception during ZooKeeper client finalization
Right now it is possible to get this error CANNOT_READ_ALL_DATA if
timings will goes wrong.

The problem is that finalize() firstly calls shutdown() on the socket,
this will trigger poll(POLLIN) (EOF) and the receiveThread() will
trigger a receiveEvent which will fail because read will return 0
(while reading length).

Note, that rearrange the code in the finalize (i.e. call shutdown()
after) since the client sends CLOSE_XID before, and the server may close
the connection already, and this will also trigger poll(POLLIN) (EOF),
and read will return 0 also.

So checking for the requests_queue.isFinished() is not enough,
finalization_started should be checked instead.

Easy reproducer:

    $ yes /keeper/api_version | head -n10000 | xargs -P30 -i clickhouse-keeper-client -q 'get {}' > /dev/null

Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2023-09-14 16:36:16 +02:00
Antonio Andelic
6306180333
Merge pull request #53049 from ClickHouse/keeper-batch-flushes
Try batching multiple flush requests in Keeper
2023-09-14 11:39:33 +02:00
Antonio Andelic
824b90f754 Merge branch 'master' into keeper-batch-flushes 2023-09-06 13:29:35 +00:00
pufit
ed43a8f1f6 Merge branch 'master' into pufit/keeper-client-reconfig 2023-09-05 23:20:12 -04:00
Alexander Gololobov
be7766ee73
Proper log message for send 2023-09-04 14:14:56 +02:00
pufit
096b44e1e5 Implementing reconfig command. Parser improvements 2023-09-01 23:34:47 -04:00
Antonio Andelic
7739dd7157 Fix integration tests 2023-08-31 14:52:42 +00:00
Raúl Marín
93dac0c880 Support clang-18 (Wmissing-field-initializers) 2023-08-23 15:53:45 +02:00
alesapin
0f413090fe
Update ZooKeeper.h 2023-08-22 22:16:25 +02:00
alesapin
1d29ab19f4 Merge branch 'master5' of https://github.com/helifu/ClickHouse into helifu-master5 2023-08-22 11:49:05 +02:00
Alexander Gololobov
d3edcaae04 Fixed for using failed_op_index before it is initialized 2023-08-18 11:19:35 +02:00
Alexander Gololobov
827ae49b95 Cleanups 2023-08-17 17:39:23 +02:00
Alexander Gololobov
80b767316d Deduplicate same watch callbacks registered multiple times 2023-08-17 17:32:04 +02:00
Alexander Tokmakov
894ec8e0d0 less exceptions with runtime format string 2023-08-14 21:45:59 +02:00
Alexey Milovidov
0c457f36df Make some Keeper exceptions more structured 2023-08-13 23:20:27 +02:00