Commit Graph

106001 Commits

Author SHA1 Message Date
Kruglov Pavel
582aa8b770
Merge pull request #45253 from Avogar/fix-s3-heap-use-after-free
Fix heap-use-after-free in reading from s3
2023-01-17 15:32:26 +01:00
HarryLeeIBM
e7add8218f Addressed more review comments and ClangTidy errors 2023-01-17 06:29:13 -08:00
Azat Khuzhin
54fc6859ae Fix race in Distributed table startup
Before this patch it was possible to have multiple directory monitors
for the same directory, one from the INSERT context, another one on
storage startup().

Here are an example of logs for this scenario:

    2022.12.07 12:12:27.552485 [ 39925 ] {a47fcb32-4f44-4dbd-94fe-0070d4ea0f6b} <Debug> DDLWorker: Executed query: DETACH TABLE inc.dist_urls_in
    ...
    2022.12.07 12:12:33.228449 [ 4408 ] {20c761d3-a46d-417b-9fcd-89a8919dd1fe} <Debug> executeQuery: (from 0.0.0.0:0, user: ) /* ddl_entry=query-0000089229 */ ATTACH TABLE inc.dist_urls_in (stage: Complete)
    ... this is the DirectoryMonitor created from the context of INSERT for the old StoragePtr that had not been destroyed yet (becase of "was 1" this can be done only from the context of INSERT) ...
    2022.12.07 12:12:35.556048 [ 39536 ] {} <Trace> inc.dist_urls_in.DirectoryMonitor: Files set to 173 (was 1)
    2022.12.07 12:12:35.556078 [ 39536 ] {} <Trace> inc.dist_urls_in.DirectoryMonitor: Bytes set to 29750181 (was 71004)
    2022.12.07 12:12:35.562716 [ 39536 ] {} <Trace> Connection (i13.ch:9000): Connected to ClickHouse server version 22.10.1.
    2022.12.07 12:12:35.562750 [ 39536 ] {} <Debug> inc.dist_urls_in.DirectoryMonitor: Sending a batch of 10 files to i13.ch:9000 (0.00 rows, 0.00 B bytes).
    ... this is the DirectoryMonitor that created during ATTACH ...
    2022.12.07 12:12:35.802080 [ 39265 ] {} <Trace> inc.dist_urls_in.DirectoryMonitor: Files set to 173 (was 0)
    2022.12.07 12:12:35.802107 [ 39265 ] {} <Trace> inc.dist_urls_in.DirectoryMonitor: Bytes set to 29750181 (was 0)
    2022.12.07 12:12:35.834216 [ 39265 ] {} <Debug> inc.dist_urls_in.DirectoryMonitor: Sending a batch of 10 files to i13.ch:9000 (0.00 rows, 0.00 B bytes).
    ...
    2022.12.07 12:12:38.532627 [ 39536 ] {} <Trace> inc.dist_urls_in.DirectoryMonitor: Sent a batch of 10 files (took 2976 ms).
    ...
    2022.12.07 12:12:38.601051 [ 39265 ] {} <Error> inc.dist_urls_in.DirectoryMonitor: std::exception. Code: 1001, type: std::__1::__fs::filesystem::filesystem_error, e.what() = filesystem error: in file_size: No such file or directory ["/data6/clickhouse/data/inc/dist_urls_in/shard13_replica1/66827403.bin"], Stack trace (when copying this message, always include the lines below):
    ...
    2022.12.07 12:12:54.132837 [ 4408 ] {20c761d3-a46d-417b-9fcd-89a8919dd1fe} <Debug> DDLWorker: Executed query: ATTACH TABLE inc.dist_urls_in

And eventually both monitors (for a short period of time, one replaces
another) are trying to process the same batch (current_batch.txt), and
one of them fails because such file had been already removed.

Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2023-01-17 14:51:00 +01:00
Igor Nikonov
6328e02f22 Fix: update input/output stream properties
After removing sorting step we need to update sorting properties of
input/ouput streams
2023-01-17 13:39:18 +00:00
Maksim Kita
d758d83937 Analyzer compound identifier typo correction fix 2023-01-17 14:29:48 +01:00
Antonio Andelic
ba363c141a Fix integration test 2023-01-17 13:12:52 +00:00
alesapin
b23ba36a4f
Merge pull request #45339 from ClickHouse/util-decompressor-wsl1
WSL1 inconsistency
2023-01-17 14:10:21 +01:00
Vitaly Baranov
8c5c423d67 Add test. 2023-01-17 13:11:24 +01:00
Sema Checherinda
35431e91e3
Merge pull request #45276 from ucasfl/avro-fix
Fix some avro reading bugs
2023-01-17 12:48:44 +01:00
Kseniia Sumarokova
5586f71950
Merge pull request #41231 from kssenii/minor-change-in-remote-read
Fix assertion in async read buffer from remote
2023-01-17 12:32:57 +01:00
kssenii
a657bbece7 Merge remote-tracking branch 'upstream/master' into slightly-better-output-for-glibc-check 2023-01-17 12:23:44 +01:00
kssenii
f3c1dc0c85 Slightly better output of glibc check 2023-01-17 12:17:57 +01:00
Maksim Kita
d6a36b1d16 Fixed code review issues 2023-01-17 12:02:50 +01:00
Sema Checherinda
2cd55bc398 fix/adjust tests in integration/test_partition 2023-01-17 12:02:18 +01:00
Maksim Kita
af716ca25d Fixed tests 2023-01-17 11:20:24 +01:00
Maksim Kita
250c93614c Revert "Revert "Validate function arguments in query tree"" 2023-01-17 11:20:24 +01:00
Vitaly Baranov
692065e5fe Fix backup if mutations got killed during the backup process. 2023-01-17 11:05:34 +01:00
Alexander Tokmakov
4e1cf778a6
Update clickhouse-test 2023-01-17 12:17:51 +03:00
Vitaly Baranov
0bea056241 Fix build. 2023-01-17 09:52:08 +01:00
Vitaly Baranov
1c845185c1 Split upload into parts of the same size for smooth uploading.
Correctly use AbortMultipleUpload request.
Support std::ios_base::end StdStreamBufFromReadBuffer::seekpos().
2023-01-17 09:35:43 +01:00
Vitaly Baranov
14a7ee8e26 Copy files to S3 during backup directly without using WriteBufferFromS3 to decrease memory consumption. 2023-01-17 09:35:41 +01:00
Vitaly Baranov
b13498d9ba
Merge pull request #45288 from vitlibar/fix-s3-requests-without-region
Fix s3 requests without region
2023-01-17 09:24:59 +01:00
Antonio Andelic
76eb3e3b3c Fix test 2023-01-17 07:34:39 +00:00
SmitaRKulkarni
bb4f251448
Merge branch 'master' into 42648_Support_scalar_subqueries_cache 2023-01-17 08:10:25 +01:00
Alexander Tokmakov
1fd8cf3d7f fix 2023-01-17 01:43:13 +01:00
Alexander Tokmakov
522686f78b less empty patterns 2023-01-17 01:19:44 +01:00
Kseniia Sumarokova
6a02bdc917
Update AsynchronousReadIndirectBufferFromRemoteFS.cpp 2023-01-17 00:37:47 +01:00
Alexander Tokmakov
870cfcc36a less fmt::runtime usages 2023-01-17 00:11:59 +01:00
Alexander Tokmakov
e7899825e6 save format strings for DB::Exceptions 2023-01-16 23:20:33 +01:00
Vitaly Baranov
9a52087989 More complex logic: GetObjectAttributes requests will be used
only if the endpoint is "*.amazonaws.com", otherwise HeadObject requests will be used.
2023-01-16 20:14:39 +01:00
Dmitry Novik
104e55bc22 Merge remote-tracking branch 'origin/master' into or-like-chain 2023-01-16 18:56:22 +00:00
Dmitry Novik
aa2a19eaa4 Use proper map for QueryTreeNode 2023-01-16 18:43:22 +00:00
Yakov Olkhovskiy
c8f635e40b WSL1 inconsistency 2023-01-16 18:32:41 +00:00
Dmitry Novik
72c1e0ae0f Rename test 2023-01-16 17:52:15 +00:00
Dmitry Novik
0aecc9ad80 Updates after the review 2023-01-16 17:43:36 +00:00
Vladimir C
b80ee8df50
Merge pull request #45256 from DanRoscigno/add-grace-hash-docs 2023-01-16 18:43:19 +01:00
Kruglov Pavel
bdb3517512
Merge pull request #45231 from Avogar/json-tuples
Insert default values in case of missing tuple elements in JSONEachRow
2023-01-16 17:49:50 +01:00
Mikhail f. Shiryaev
51b5d647ae
Merge pull request #45302 from ClickHouse/fix-automerge-approved-at
Fix wrong approved_at, simplify conditions
2023-01-16 17:46:30 +01:00
Alexander Tokmakov
753ae9e80d
Merge pull request #45327 from ClickHouse/revert-45252-block-nonfloat-gorilla
Revert "Disallow Gorilla codec on non-float columns"
2023-01-16 19:16:06 +03:00
Alexander Tokmakov
df75c24f01
Revert "Disallow Gorilla codec on non-float columns" 2023-01-16 19:14:28 +03:00
Mikhail f. Shiryaev
08c9d81c90
Apply suggestions from code review
Co-authored-by: Igor Nikonov <954088+devcrafter@users.noreply.github.com>
2023-01-16 16:55:24 +01:00
Sema Checherinda
dbe89cd5d8 fix that optimize final waits for currently running merges 2023-01-16 16:47:12 +01:00
Sema Checherinda
9c76161c06 some tests delete empty parts instantly 2023-01-16 16:47:12 +01:00
Sema Checherinda
95045c6738 Revert "make tests with optimize final more stable, wait for merges in flight"
This reverts commit d34f5df84cbd453ece4a234f216a68438930202f.
2023-01-16 16:47:12 +01:00
Sema Checherinda
90fa1ecd49 make that old_parts_lifetime=0 deletes files instantly at drop/truncate 2023-01-16 16:47:12 +01:00
Sema Checherinda
8218d59103 make tests with optimize final more stable, wait for merges in flight 2023-01-16 16:47:12 +01:00
Sema Checherinda
8f660afab3 style fix 2023-01-16 16:47:12 +01:00
Sema Checherinda
f77b0d3891 cannonization 02521 2023-01-16 16:47:11 +01:00
Sema Checherinda
c51f4d7be1 do not merge over a gap with uotdate parts, delete empty parts with respect to old_parts_lifetime 2023-01-16 16:47:11 +01:00
Sema Checherinda
25e16388d7 better message in MergeTreeDataMergerMutator when parts intersect 2023-01-16 16:47:11 +01:00