Commit Graph

14732 Commits

Author SHA1 Message Date
alesapin
81c74435a3 Fix drop part bug 2021-06-23 22:25:30 +03:00
Nikolai Kochetov
8bfa26102b
Merge pull request #25631 from ClickHouse/fix-explain-ast-no-query-crash
Fix crash in EXPLAIN AST without query.
2021-06-23 19:56:59 +03:00
Kruglov Pavel
4913b18532
Merge pull request #25531 from Avogar/fix-arrow-decimal
Fix segfault in Arrow format, add arrow Decimal256 support in Arrow and Parquet.
2021-06-23 17:28:16 +03:00
Nikolai Kochetov
c92c352d9a Fix crash in EXPLAIN AST without query. 2021-06-23 15:29:10 +03:00
Anton Popov
a15ee72d0f Merge remote-tracking branch 'upstream/master' into HEAD 2021-06-23 13:53:01 +03:00
Anton Popov
93f15e443d
Merge pull request #25539 from CurtizJ/with-fill-totals
Fix usage of `WITH FILL` together with `WITH TOTALS`
2021-06-23 13:42:27 +03:00
Kseniia Sumarokova
3e238c1767
Merge pull request #25601 from ianton-ru/fix_s3_restore
Fix DiskS3 restore
2021-06-23 12:34:50 +03:00
Azat Khuzhin
50d9d3efd5 Remove only symlinks during force_restore_data of Atomic engine 2021-06-23 10:17:31 +03:00
Azat Khuzhin
3bd53c68f9 Try to split the batch in case of broken batch too
Broken batches may be because of abnormal server shutdown (and lack of
fsync), and ignoring the whole batch is not great in this case, so apply
the same split logic here too.

v2: rename exception
v3: catch missing exception
v4: fix marking the file as broken multiple times (fixes
test_insert_distributed_async_send with setting enabled)
2021-06-23 02:48:47 +03:00
Azat Khuzhin
a0209178cc Add ability to split distributed batch on failures
Add distributed_directory_monitor_split_batch_on_failure setting (OFF by
default), that will split the batch and send files one by one in case of
retriable errors.

v2: more error codes
2021-06-23 02:48:47 +03:00
Azat Khuzhin
e148ef739d Drop replicas from dirname for internal_replication=true
Under use_compact_format_in_distributed_parts_names=1 and
internal_replication=true the server encodes all replicas for the
directory name for async INSERT into Distributed, and the directory name
looks like:

    shard1_replica1,shard1_replica2,shard3_replica3

This is required for creating connections (to specific replicas only),
but in case of internal_replication=true, this can be avoided, since
this path will always includes all replicas.

This patch replaces all replicas with "_all_replicas" marker.

Note, that initial problem was that this path may overflow the NAME_MAX
if you will have more then 15 replicas, and the server will fail to
create the directory.

Also note, that changed directory name should not be a problem, since:
- empty directories will be removed since #16729
- and replicas encoded in the directory name is also supported anyway.
2021-06-23 02:47:38 +03:00
Alexey Milovidov
afeb562744 Small change in Roaring Bitmaps 2021-06-23 00:29:20 +03:00
Anton Ivashkin
e0199d8006 Fix DiskS3 restore 2021-06-22 20:05:20 +03:00
Anton Popov
18fad6d322 Merge remote-tracking branch 'upstream/master' into HEAD 2021-06-22 19:20:59 +03:00
mergify[bot]
c15493f0df
Merge branch 'master' into add_test_for_concurrent_merges 2021-06-22 15:49:35 +00:00
alexey-milovidov
d6b93f3af8
Merge pull request #25584 from kelvich/patch-1
Fix typo in hardware failure error message
2021-06-22 18:38:00 +03:00
vdimir
80a001ab0c
Use settings from global context in StorageView 2021-06-22 17:39:09 +03:00
vdimir
85bcf8a1dc
Merge branch 'master' into view-join-settings 2021-06-22 17:36:44 +03:00
tavplubix
a6a43ce3ee
Revert "Implement h3ToGeo function" 2021-06-22 17:25:21 +03:00
alesapin
47b29092b4 Fix bug in MergerMutator parts selector 2021-06-22 16:47:42 +03:00
Anton Popov
ac25b55e87
Merge pull request #25546 from CurtizJ/fix-index-array-join
Fix usage of index with array columns and ARRAY JOIN
2021-06-22 16:23:00 +03:00
Nikita Mikhaylov
2ec3bc2d96
Merge pull request #25520 from azat/not-parser-fix
Fix NOT parsing
2021-06-22 16:19:39 +03:00
Anton Popov
447fef702d fix fuzzer in query with 'WITH FILL' and 'WITH TOTALS' 2021-06-22 16:08:12 +03:00
Nikita Mikhaylov
19b3659517
Merge pull request #24867 from bharatnc/ncb/h3-indexing-funcs
Implement h3ToGeo function
2021-06-22 15:59:09 +03:00
Stas Kelvich
9a84033db5
Fix typo in hardware failure error message 2021-06-22 12:48:15 +03:00
alesapin
a8ce3bed2b
Merge pull request #25421 from ClickHouse/update_buffer_size_in_nuraft
Update NuRaft buffer to 64 bit size
2021-06-22 10:55:31 +03:00
Kseniia Sumarokova
155bb03239
Merge branch 'master' into pg-dix 2021-06-22 10:14:52 +03:00
Kseniia Sumarokova
41c65a9965
Merge pull request #25528 from kssenii/something
Fix convertion of datetime with timezone for mysql, odbc, etc..
2021-06-21 22:55:22 +03:00
Kseniia Sumarokova
77a3a1416d
Update fetchPostgreSQLTableStructure.cpp 2021-06-21 17:26:14 +03:00
Anton Popov
ffa56bde24 fix usage of index with array columns and ARRAY JOIN 2021-06-21 15:34:05 +03:00
kssenii
7d3dee172c FIx progress 2021-06-21 12:19:25 +00:00
Anton Popov
82f0a5f2dd fix usage of WITH FILL together with WITH TOTALS 2021-06-21 14:43:38 +03:00
kssenii
0f9fc33a4e Fix postgres arrays 2021-06-21 11:27:10 +00:00
kssenii
fb9c92cb6c Fix 2021-06-21 10:32:40 +00:00
alesapin
2f24ad6165 Merge branch 'fix_some_tests' into update_buffer_size_in_nuraft 2021-06-21 13:20:27 +03:00
Anton Popov
c2754c34f4 Merge remote-tracking branch 'upstream/master' into HEAD 2021-06-21 12:42:48 +03:00
alexey-milovidov
8ba6a5393f
Merge pull request #25509 from azat/fix-altstack
Fix alternative stack for SIGSEGV handling
2021-06-21 12:10:00 +03:00
alexey-milovidov
d2c86e52e6
Update checkStackSize.cpp 2021-06-21 12:09:14 +03:00
alexey-milovidov
f37faf02fa
Update checkStackSize.cpp 2021-06-21 12:08:30 +03:00
alexey-milovidov
9a4125dd7c
Update ThreadStatus.cpp 2021-06-21 12:06:41 +03:00
Pavel Kruglov
556ec9e533 Fix segfault in arrow and support Decimal256 2021-06-21 12:06:28 +03:00
kssenii
c0732ddc12 Fix datetime with timezone 2021-06-21 08:22:12 +00:00
Kruglov Pavel
a54cbef5b7
Merge pull request #24341 from Avogar/arrow
Support complex types in Arrow/Parquet/ORC
2021-06-21 11:05:57 +03:00
Azat Khuzhin
fabff86788 Fix NOT parsing 2021-06-20 23:27:24 +03:00
Anton Popov
e409ead64a fix tests 2021-06-20 23:18:05 +03:00
Anton Popov
d8b6f15ef4
Merge pull request #23027 from azat/distributed-push-down-limit
Add ability to push down LIMIT for distributed queries
2021-06-20 23:08:50 +03:00
Azat Khuzhin
12eadc2b5e Add a guard page for alternative signal handling stack 2021-06-20 20:08:50 +03:00
Azat Khuzhin
4dcbf3a5c5 Replace __pthread_get_minstack() with a const 2021-06-20 14:03:04 +03:00
Mike Kot
4c391f8e99
SYSTEM RESTORE REPLICA replica [ON CLUSTER cluster] (#13652)
* initial commit: add setting and stub

* typo

* added test stub

* fix

* wip merging new integration test and code proto

* adding steps interpreters

* adding firstly proposed solution (moving parts etc)

* added checking zookeeper path existence

* fixing the include

* fixing and sorting includes

* fixing outdated struct

* fix the name

* added ast ptr as level of indirection

* fix ref

* updating the changes

* working on test stub

* fix iterator -> reference

* revert rocksdb submodule update

* fixed show privileges test

* updated the test stub

* replaced rand() with thread_local_rng(), updated the tests

updated the test

fixed test config path

test fix

removed error messages

fixed the test

updated the test

fixed string literal

fixed literal

typo: =

* fixed the empty replica error message

* updated the test and the code with logs

* updated the possible test cases, updated

* added the code/test milestone comments

* updated the test (added more testcases)

* replaced native assert with CH one

* individual replicas recursive delete fix

* updated the AS db.name AST

* two small logging fixes

* manually generated AST fixes

* Updated the test, added the possible algo change

* Some thoughts about optimizing the solution:

ALTER MOVE PARTITION .. TO TABLE -> move to detached/ + ALTER ... ATTACH

* fix

* Removed the replica sync in test as it's invalid

* Some test tweaks

* tmp

* Rewrote the algo by using the executeQuery instead of

hand-crafting the ASTPtr.

Two questions still active.

* tr: logging active parts

* Extracted the parts moving algo into a separate helper function

* Fixed the test data and the queries slightly

* Replaced query to system.parts to direct invocation,

started building the test that breaks on various parts.

* Added the case for tables when at least one replica is alive

* Updated the test to test replicas restoration by detaching/attaching

* Altered the test to check restoration without replica restart

* Added the tables swap in the start if the server failed last time

* Hotfix when only /replicas/replica... path was deleted

* Restore ZK paths while creating a replicated MergeTree table

* Updated the docs, fixed the algo for individual replicas restoration case

* Initial parts table storage fix, tests sync fix

* Reverted individual replica restoration to general algo

* Slightly optimised getDataParts

* Trying another solution with parts detaching

* Rewrote algo without any steps, added ON CLUSTER support

* Attaching parts from other replica on restoration

* Getting part checksums from ZK

* Removed ON CLUSTER, finished working solution

* Multiple small changes after review

* Fixing parallel test

* Supporting rewritten form on cluster

* Test fix

* Moar logging

* Using source replica as checksum provider

* improve test, remove some code from parser

* Trying solution with move to detached + forget

* Moving all parts (not only Committed) to detached

* Edited docs for RESTORE REPLICA

* Re-merging

* minor fixes

Co-authored-by: Alexander Tokmakov <avtokmakov@yandex-team.ru>
2021-06-20 11:24:43 +03:00
Azat Khuzhin
9a3a1397e6 Fix alternative stack for SIGSEGV handling
Previous stack size of 4096 wasn't enough, and this lead to that on
SIGSEGV signal handler may overwrite some TLS data (like in the
following example [1]) and in real binary "current_thread" was
overwritten, and this leads to lack of query-id on SIGSEGV, like here
[2].

  [1]: https://gist.github.com/azat/2ee360fd4f2828d363b0926431afacc6
  [2]: https://clickhouse-test-reports.s3.yandex.net/24411/79563953201ce6249a8fd49e22be3902ca4ee43a/fuzzer_ubsan/report.html#fail1

Fix this by using __pthread_get_minstack() that takes TLS block into
account. Yes it is private, but let's try (like rust tried).

This patch will also decrease TLS, since now the per-thread stack will
be allocated in the heap, not on the stack of each thread.

Refs: https://sourceware.org/legacy-ml/libc-alpha/2012-06/msg00335.html
Refs: https://maskray.me/blog/2021-02-14-all-about-thread-local-storage
Refs: https://sourceware.org/bugzilla/show_bug.cgi?id=11787
2021-06-19 22:47:01 +03:00
Azat Khuzhin
57960746e2 Add getStackSize() helper 2021-06-19 20:09:01 +03:00
Azat Khuzhin
c6339b4c08 Stable NOT chain formatting 2021-06-19 08:03:36 +03:00
Vladimir
1c91a8d2c2
Merge pull request #25454 from vdimir/issue-23351-v2 2021-06-18 21:56:46 +03:00
Kseniia Sumarokova
4fe722d1a4
Merge pull request #25431 from vitlibar/no-underscore_before-preprocessed_configs
Fix underscore before preprocessed configs.
2021-06-18 17:53:03 +03:00
Kseniia Sumarokova
5974f96f0c
Merge pull request #23656 from kssenii/progress-bar
Progress indication for File table engine in clickhouse-local and insert from file in clickhouse-client
2021-06-18 17:46:54 +03:00
mergify[bot]
c723dd7d40
Merge branch 'master' into arrow 2021-06-18 12:18:57 +00:00
vdimir
0ebca58e86
Check column in removeColumnNullability 2021-06-18 14:06:55 +03:00
Vladimir
4de0d1a593
Merge pull request #24885 from Jokser/disk-s3-read-error-fix 2021-06-18 13:38:59 +03:00
Vladimir
6af272891a
Merge pull request #24870 from azat/mv-dist-join-fix 2021-06-18 11:18:43 +03:00
vdimir
b25f6ba5b6
Remove assumeMutable from removeColumnNullability 2021-06-18 11:13:53 +03:00
Vladimir
fab7c9c7f6
Merge pull request #24061 from vdimir/issue-23351 2021-06-18 11:07:28 +03:00
Vladimir
51e5a019ed
Merge pull request #25410 from vdimir/issue-21730 2021-06-18 11:00:26 +03:00
kssenii
f7029b168b Generate ya make 2021-06-18 10:56:24 +03:00
kssenii
bdc8fe1ca0 Merge branch 'master' of github.com:ClickHouse/ClickHouse into progress-bar 2021-06-18 09:33:29 +03:00
Nikolai Kochetov
b2620e1def
Merge pull request #24405 from amosbird/replacemorealias
Rewrite more alias columns
2021-06-18 09:10:31 +03:00
Vitaly Baranov
fc3d77bd66 Fix underscore before preprocessed configs. 2021-06-18 06:14:11 +03:00
Alexey Milovidov
3e71181451 Whitespaces 2021-06-18 01:42:33 +03:00
Maksim Kita
b34b66c55d
Merge pull request #25394 from ClickHouse/function-bit-position-to-array-merge
Merging #23843
2021-06-18 01:31:33 +03:00
Maksim Kita
2c4c2680f7
Merge pull request #25430 from kitaisreal/database-mysql-rename
DatabaseMySQL rename
2021-06-18 01:30:52 +03:00
Kseniia Sumarokova
47cb288834
Update src/Common/ProgressIndication.h
Co-authored-by: Alexander Kuzmenkov <36882414+akuzm@users.noreply.github.com>
2021-06-18 00:24:28 +03:00
Nikolai Kochetov
669b8a8b96
Merge pull request #25370 from ClickHouse/disable-query_plan_filter_push_down-because-of-25368
Fix lost WHERE condition in expression-push-down optimization of query plan
2021-06-17 23:07:32 +03:00
Nikolai Kochetov
5227a76e3a Add comment. 2021-06-17 23:05:39 +03:00
Maksim Kita
ca672b0a0d Function bitPositionsToArray added support for big integers 2021-06-17 22:32:39 +03:00
Pavel Kovalenko
ce8e2f7f28 Avoid double initializing ReadBufferFromS3 2021-06-17 22:31:50 +03:00
Maksim Kita
cf77e9f2c6 DatabaseMySQL rename 2021-06-17 22:26:34 +03:00
Vladimir
9e5ef95677
Merge pull request #25288 from amosbird/fixjoingetornull 2021-06-17 21:54:21 +03:00
alexey-milovidov
35411d1085
Merge pull request #24427 from azat/formatting-fixes
Fix formatting of negative values
2021-06-17 21:21:47 +03:00
alexey-milovidov
496aff2118
Merge pull request #25300 from ClickHouse/simpla-agg-func-for-summing-mt
Support simple aggregate functions for SummingMergeTree.
2021-06-17 20:18:51 +03:00
alexey-milovidov
c48402d997
Merge pull request #23434 from amosbird/preferglobal
Add prefer_global_in_and_join setting
2021-06-17 19:48:28 +03:00
alesapin
dc893f9644 Update NuRaft buffer to 64 bit size 2021-06-17 19:37:08 +03:00
Amos Bird
0f7728cd5e
Fix RBAC test again 2021-06-17 23:00:03 +08:00
Kseniia Sumarokova
f9c0bfb769
Merge pull request #25199 from sand6255/MySQL-column-comments-support
MaterializeMySQL Engine column comments support
2021-06-17 17:08:53 +03:00
vdimir
23fb229dec
Merge branch 'update_01049_join_low_card_bug' into issue-23351 2021-06-17 15:38:40 +03:00
vdimir
e34a6525ef
Support Interval for LowCardinality 2021-06-17 15:28:08 +03:00
Matwey V. Kornilov
aa1ac2a506 Add missed #include <optional>
This is required for std::optional<std::string> language;

Signed-off-by: Matwey V. Kornilov <matwey.kornilov@gmail.com>
2021-06-17 14:41:28 +03:00
Maksim Kita
6d44aa3034 Fixed style check 2021-06-17 13:26:40 +03:00
vdimir
0cee5ad8e8
Use IColumn::mutate in JoinCommon::convertColumnToNullable 2021-06-17 13:24:17 +03:00
vdimir
ebdce8e1a6
Fix JoinCommon::convertColumnToNullable for LC(Nullable) 2021-06-17 13:17:28 +03:00
Matwey V. Kornilov
37180e0842 Add missed #include <optional>
std::optional<> is used multiple times here.

Signed-off-by: Matwey V. Kornilov <matwey.kornilov@gmail.com>
2021-06-17 13:14:56 +03:00
Nikolai Kochetov
4a496f1374 Fix lost considion in predicate push down. 2021-06-17 12:47:12 +03:00
Maksim Kita
bc86b2b738 Updated function bitPositionsToArray before merge 2021-06-17 12:20:53 +03:00
Vladimir
7a56ab8b1d
Merge pull request #25299 from mga-chka/equals_op_in_sequence_functions 2021-06-17 11:45:04 +03:00
mergify[bot]
13fdefebf5
Merge branch 'master' into fixjoingetornull 2021-06-17 08:26:13 +00:00
Yuriy Chernyshov
2bb1c75fb5 Rename & reimport murmurhash sources from smhasher repo 2021-06-17 10:58:42 +03:00
Maksim Kita
5b2380d541
Merge branch 'function-bit-position-to-array-merge' into feature-function-bitpositionToArray 2021-06-17 10:23:41 +03:00
Maksim Kita
37770f20fc
Merge pull request #25372 from ClickHouse/add-date-name-function-merge
Merging #23085
2021-06-17 10:16:32 +03:00
Azat Khuzhin
9242654231 negate: replace special case with parens
v0: negate: add parens for negative values
    Before this patch -(-1) was formatted to --1, but this is not valid
    syntax.
v2: replace special case with parens, otherwise formatting of -(-(-1))
    will be unstable, in v0 it was formatted to -(1) but -(1) is
    formatted to -1 [1].

  [1]: https://clickhouse-test-reports.s3.yandex.net/24427/4512460aeb02fec557c558eee3f8291a6297efb2/fuzzer_asan/fuzzer.log
2021-06-17 10:07:03 +03:00
Amos Bird
31815f4a68
Proper documentation of the setting 2021-06-17 14:27:33 +08:00
Amos Bird
c8ea6527cb
Add prefer_global_in_and_join setting 2021-06-17 14:27:29 +08:00
alexey-milovidov
fffd69b023
Merge pull request #25283 from ClickHouse/if-support-int-decimal
Remove code and fix #20549
2021-06-17 09:17:42 +03:00