Commit Graph

143959 Commits

Author SHA1 Message Date
Azat Khuzhin
6f522c1d61 Do not remove detached parts in Transaction::rollback
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2024-06-05 19:38:24 +02:00
Azat Khuzhin
3675c27fe9 Require explicit rename of parts in transaction
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2024-06-05 19:38:24 +02:00
Azat Khuzhin
ca2c720d0e Avoid race between cleanup thread and renameMergedTemporaryPart()
The problem was that with this patch set renameMergedTemporaryPart() is
called without temporary_directory_lock holded (in MergeTask), since it
is reseted just before calling renameMergedTemporaryPart(), and this can
be seen in logs:

    2024.03.29 19:56:42.126919 [ 1341 ] {ea7a3fd2-cf47-4ec7-91a5-51c69fba1b95::-8_0_138_2_2} <Trace> test_btnct5cr.alter_table_0 (ea7a3fd2-cf47-4ec7-91a5-51c69fba1b95) (MergerMutator): Merged 50 parts: [-8_0_0_0_2, -8_138_138_0] -> -8_0_138_2_2
    2024.03.29 19:56:42.127034 [ 1341 ] {ea7a3fd2-cf47-4ec7-91a5-51c69fba1b95::-8_0_138_2_2} <Debug> test_btnct5cr.alter_table_0 (ea7a3fd2-cf47-4ec7-91a5-51c69fba1b95): Committing part -8_0_138_2_2 to zookeeper
    2024.03.29 19:56:42.128462 [ 884 ] {} <Warning> test_btnct5cr.alter_table_0 (ea7a3fd2-cf47-4ec7-91a5-51c69fba1b95): Removing temporary directory /var/lib/clickhouse/store/ea7/ea7a3fd2-cf47-4ec7-91a5-51c69fba1b95/tmp_merge_-8_0_138_2_2/
    2024.03.29 19:56:42.128647 [ 1341 ] {ea7a3fd2-cf47-4ec7-91a5-51c69fba1b95::-8_0_138_2_2} <Debug> test_btnct5cr.alter_table_0 (ea7a3fd2-cf47-4ec7-91a5-51c69fba1b95): Part -8_0_138_2_2 committed to zookeeper
    ...
    2024.03.29 19:56:54.586084 [ 57841 ] {bf240267-0620-4294-afc1-479c58e6be89} <Error> executeQuery: std::exception. Code: 1001, type: std::__1::__fs::filesystem::filesystem_error, e.what() = filesystem error: in file_size: No such file or directory ["/var/lib/clickhouse/store/ea7/ea7a3fd2-cf47-4ec7-91a5-51c69fba1b95/-8_0_138_2_2/data.cmrk3"]

This should fix failures of 00993_system_parts_race_condition_drop_zookeeper in [1].

  [1]: https://s3.amazonaws.com/clickhouse-test-reports/61973/f6f826c85dd5b7bb8db16286fd10dcf441a440f7/stateless_tests__coverage__[4_6].html

Though now it looks hackish...

Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2024-06-05 19:38:24 +02:00
Azat Khuzhin
b41d08a2b6 Use renameParts() explicitly to avoid leaving parts in detached
Since there is an assertion that does not allows to remove detached
parts during cleanup, which sounds good in general, but breaks this new
code.

Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2024-06-05 19:38:24 +02:00
Azat Khuzhin
ee546fa00a Fix replacing parts with empty
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2024-06-05 19:38:24 +02:00
Azat Khuzhin
6c3db34aae Remove unused locked_parts from MergeTreeData::Transaction
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2024-06-05 19:38:24 +02:00
Azat Khuzhin
78088ce59a Reduce lock contention for MergeTree tables (by renaming parts without holding lock)
Under heavy load, or not so heavy but with fsync_part_directory=1,
time that renameTo() holds DataPartsLock will be increased, and this
will affect almost every operation with this table.

On one of production clusters I saw ~60 seconds with
fsync_part_directory=1.

Move the renameTo() out from the critical section.

v2: instead of using DataPartsLock.lock.lock()/unlock() move the renameTo() into MergeTreeData::Transaction::commit()
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2024-06-05 19:38:23 +02:00
Azat Khuzhin
66a2962cce Add reason into "Part {} is broken and need manual correction" message
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2024-06-05 19:38:23 +02:00
alesapin
966b08f192 Fix segfault for a very tricky case 2024-06-05 19:26:20 +02:00
Nikolai Kochetov
8bbf46ce2f Trying to fix a test. 2024-06-05 17:15:48 +00:00
Alexey Milovidov
0a67eb868e
Merge pull request #57098 from ClickHouse/analyzer-fuzz-2
Analyzer fuzzer 2
2024-06-05 16:52:41 +00:00
kssenii
5ec3699a19 Fix test 2024-06-05 18:36:13 +02:00
Sergei Trifonov
9c7a8727d0
Merge pull request #64244 from kirillgarbar/check_zk_path
Prevent conversion to Replicated if zookeeper path already exists
2024-06-05 16:36:10 +00:00
Nikita Mikhaylov
b2144b45d0
Update 10_question.yaml 2024-06-05 18:00:03 +02:00
Alexey Milovidov
9324784ceb
Update settings.md 2024-06-05 17:54:44 +02:00
Nikolai Kochetov
ee5100171e Avoid duplicating names for new inputs of ActionsDAG::split result. 2024-06-05 15:50:27 +00:00
xogoodnow
5aec5ea8ef Added mlock_executable parameter 2024-06-05 19:15:00 +03:30
xogoodnow
3cd699fc80 Added listen_try and listen_reuse_port parameters 2024-06-05 18:48:45 +03:30
Nikita Mikhaylov
4b27d38fe6
Update 10_question.yaml 2024-06-05 17:13:30 +02:00
Nikita Mikhaylov
e29185f05e
Replace Markdown with YAML 2024-06-05 17:02:09 +02:00
vdimir
5251febf03
Merge pull request #64393 from ClickHouse/vdimir/blob_storage_log_fix_recursion
Prevent recursive logging in blob_storage_log
2024-06-05 14:28:01 +00:00
kssenii
98b7805697 Fix unused field 2024-06-05 16:19:17 +02:00
Mikhail Gorshkov
7ce67265c7 PR post-review fixes 2024-06-05 14:06:31 +00:00
Robert Schulze
8bdd291049
Simplify handling of old 'inverted' indexes 2024-06-05 13:27:07 +00:00
kssenii
2a30c77346 Fix compatibility 2024-06-05 15:21:51 +02:00
Mikhail Gorshkov
83901b82c9 Merge branch 'master' of github.com:ClickHouse/ClickHouse into ADQM-1892 2024-06-05 13:13:06 +00:00
Anton Popov
5e9a41bd9f fix untacked memory in MemoryTrackerSwitcher 2024-06-05 13:10:37 +00:00
alesapin
1c346d5c2e Bump 2024-06-05 15:04:48 +02:00
alesapin
59784a4cf2 Upload blob_storage_log from stateless tests 2024-06-05 15:04:15 +02:00
Han Fei
ac430bb01d
Merge pull request #59357 from hanfei1991/hanfei/stats_uniq
Introduce statistics of type "number of distinct values"
2024-06-05 12:56:52 +00:00
Azat Khuzhin
11905682a9 Check python code with flake8
Recently assert-on-tuple had been introduced in tests [1], let's prevent
this.

  [1]: https://github.com/ClickHouse/ClickHouse/pull/56367#discussion_r1437098533

v2: pin flake8 to 4.0.1 (instead of originally 6.1) due to other dependencies, hope that it will find such errors
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2024-06-05 14:46:38 +02:00
Azat Khuzhin
b2535d7f50 Fix invalid escape sequence warnings
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2024-06-05 14:46:38 +02:00
Azat Khuzhin
a474816fc7 Add missing botocore import into clickhouse_backupview.py
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2024-06-05 14:46:38 +02:00
Azat Khuzhin
69d23f5e67 Fix all problems in tests that had been found by flake8
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2024-06-05 14:46:38 +02:00
vdimir
d2d8618d27
Merge pull request #64775 from bigo-sg/debug_inequal_join
Mixed join condition with function `in`
2024-06-05 12:40:30 +00:00
Robert Schulze
1628c2985d Some fixups 2024-06-05 11:55:55 +00:00
Han Fei
9b7944e3a5
Merge pull request #64827 from ClickHouse/fix-clang-tidy-s3-queue
Fix clang-tidy
2024-06-05 11:54:14 +00:00
Yarik Briukhovetskyi
2fef05e9c9
Merge pull request #64819 from avinzhang/patch-1
Update mongodb.md
2024-06-05 11:44:49 +00:00
Kseniia Sumarokova
b6b19ca6d3
Merge pull request #64762 from azat/mt-write-once-fixes
Do not try to write columns.txt if it does not exists for write-once storages
2024-06-05 11:22:54 +00:00
Igor Nikonov
22d50dcd3e
Merge pull request #64579 from ClickHouse/store-analysis-result
Cache first analysis result in ReadFromMergeTree
2024-06-05 11:21:50 +00:00
Yarik Briukhovetskyi
2eec012e39
reload CI 2024-06-05 13:18:09 +02:00
Yarik Briukhovetskyi
fbe29c0737
remove trailing whitespace 2024-06-05 13:16:38 +02:00
Han Fei
c04e7e64af Merge branch 'master' into hanfei/stats_uniq 2024-06-05 13:09:15 +02:00
Yarik Briukhovetskyi
73d0b51283
Merge pull request #64220 from yariks5s/test_distributed_table_exception
Add test for #37090
2024-06-05 10:49:31 +00:00
Robert Schulze
88da651dd7
Merge pull request #64837 from tomershafir/xray-build-amd64-linux-only
xray: rename cmake file and build only on amd64 linux
2024-06-05 10:32:16 +00:00
Kseniia Sumarokova
f50fbfa411
Merge pull request #64803 from ClickHouse/fix-memory-leak-in-slru
Fix memory leak in slru cache policy
2024-06-05 09:58:12 +00:00
Kseniia Sumarokova
ba90cf22f6
Merge branch 'master' into fix-clang-tidy-s3-queue 2024-06-05 11:48:04 +02:00
tomershafir
3e8929f5f0 xray: rename cmake file and build only on amd64 linux 2024-06-05 12:40:18 +03:00
Blargian
5f3bc4271f rename forgoten isEscapeSequence to is_escape_sequence 2024-06-05 10:58:30 +02:00
kssenii
c25f8fa28c Fix 2024-06-05 10:58:08 +02:00