Commit Graph

93503 Commits

Author SHA1 Message Date
Igor Nikonov
a54033b749 EXPLAIN AST rewrite: additional query in test 2022-07-19 11:54:22 +00:00
Robert Schulze
9d0e3d107b
Update src/Functions/formatReadableTimeDelta.cpp
Co-authored-by: Nikolay Degterinsky <43110995+evillique@users.noreply.github.com>
2022-07-19 13:17:33 +02:00
alesapin
bdc09c8319
Merge pull request #39303 from ClickHouse/whitespaces
Whitespaces
2022-07-19 13:17:29 +02:00
Alexander Tokmakov
3e7414b356 add comment 2022-07-19 12:47:20 +02:00
Kruglov Pavel
12221cffc9
Merge pull request #39071 from jiahui-97/parse_timedelta
implementation of parseTimeDelta function
2022-07-19 12:39:56 +02:00
Alexander Tokmakov
acb1fa53ed
Merge pull request #39341 from ClickHouse/fix_memory_exceptions_with_transactions
Fix memory exceptions with transactions
2022-07-19 13:31:15 +03:00
Alexander Tokmakov
1fff3b24b8
Merge pull request #39337 from ClickHouse/minor_fix_for_ordinary_database
Do not start on unexpected Ordinary metadata
2022-07-19 13:30:56 +03:00
Alexander Tokmakov
115c8d9b5f
Merge pull request #39339 from ClickHouse/fix_flaky_01174_select_insert_isolation
Fix flaky 01174_select_insert_isolation
2022-07-19 13:29:27 +03:00
Nikolai Kochetov
d0db7135cb
Merge pull request #38946 from amosbird/nullable-partition-fix1
Fix incorrect partition pruning when there is a nullable partition
2022-07-19 12:14:36 +02:00
Kseniia Sumarokova
f168e0c5d0
Merge pull request #39272 from kssenii/fixes-for-materialized-pg
Fix segfault in materialised postgresql
2022-07-19 11:56:10 +02:00
Nikolay Degterinsky
142701223d
Merge pull request #39361 from ClickHouse/Avogar-patch-1
Fix typo
2022-07-19 11:50:49 +02:00
Antonio Andelic
ce570b6ee3 Add logs and 4LW for api version 2022-07-19 09:02:57 +00:00
Antonio Andelic
e6ded88ea3 Small refactoring 2022-07-19 08:51:12 +00:00
Vitaly Baranov
6b03f200e4
Merge pull request #39322 from vitlibar/auto-set-test-name-in-integration-tests
Auto set test name in integration tests
2022-07-19 10:44:38 +02:00
Mikhail f. Shiryaev
617f774829
Merge pull request #39235 from ClickHouse/backport-script
Backport script
2022-07-19 10:36:24 +02:00
Robert Schulze
81ef1099cc
Even less usage of StringRef
--> see #39300
2022-07-19 07:01:06 +00:00
jiahui-97
e7af88b688 implementation of parseTimeDelta function
Co-authored-by: Kruglov Pavel <48961922+Avogar@users.noreply.github.com>
2022-07-19 09:33:02 +08:00
Alexander Tokmakov
d82f378a9d do not enqueue uneeded parts for check 2022-07-18 23:37:07 +02:00
avogar
6eb234a1cc Avoid abort() in capnproto on exception descruction 2022-07-18 19:53:24 +00:00
Kruglov Pavel
1513285166
Fix typo 2022-07-18 20:54:13 +02:00
Kruglov Pavel
07210c7b55
Merge pull request #39360 from ClickHouse/Avogar-patch-1
Fix typo
2022-07-18 20:53:33 +02:00
Vitaly Baranov
725ad5bf22
Update cluster.py 2022-07-18 20:49:30 +02:00
Alexander Tokmakov
ffc50fe6ab
Merge pull request #39334 from ClickHouse/try_fix_flaky_test_store_cleanup
Try fix flaky test_store_cleanup
2022-07-18 21:44:40 +03:00
Kruglov Pavel
9dd370e2ec
Fix typo 2022-07-18 20:15:18 +02:00
Robert Schulze
6df3c9d799
Merge pull request #39300 from ClickHouse/stringref-to-stringview
First try at reducing the use of StringRef
2022-07-18 19:20:16 +02:00
Kruglov Pavel
c7569d8b05
Fix build 2022-07-18 18:28:42 +02:00
Azat Khuzhin
c6f7698f9a Fix possible UB in MergeTreeBackgroundExecutor
Lambda erase_from_active() captures the item (TaskRuntimeDataPtr), most
of the code path is OK, since it explicitly reset the item->task.

However one is not, when it moves the item to pending list, which will
be cleaned up when the table will be DROP/DETACH'ed, from
MergeTreeBackgroundExecutor::removeTasksCorrespondingToStorage(),
and in this case if IStorage will be already removed, then it will lead
to use-after-free on destroying the lambda, since it captures the item
by value.

And I belive that CI founds this issue here [1]:

<details>

<summary>stack trace</summary>

    4 0x268d1354 in DB::ReplicatedMergeTreeQueue::CurrentlyExecuting::~CurrentlyExecuting() build_docker/../src/Storages/MergeTree/ReplicatedMergeTreeQueue.cpp:1510:33
    5 0x268ead1a in std::__1::default_delete<DB::ReplicatedMergeTreeQueue::CurrentlyExecuting>::operator()(DB::ReplicatedMergeTreeQueue::CurrentlyExecuting*) const build_docker/../contrib/libcxx/include/__memory/unique_ptr.h:54:5
    6 0x268ead1a in std::__1::unique_ptr<DB::ReplicatedMergeTreeQueue::CurrentlyExecuting, std::__1::default_delete<DB::ReplicatedMergeTreeQueue::CurrentlyExecuting> >::reset(DB::ReplicatedMergeTreeQueue::CurrentlyExecuting*) build_docker/../contrib/libcxx/include/__memory/unique_ptr.h:315:7
    7 0x268ead1a in std::__1::unique_ptr<DB::ReplicatedMergeTreeQueue::CurrentlyExecuting, std::__1::default_delete<DB::ReplicatedMergeTreeQueue::CurrentlyExecuting> >::~unique_ptr() build_docker/../contrib/libcxx/include/__memory/unique_ptr.h:269:19
    8 0x268ead1a in DB::ReplicatedMergeTreeQueue::SelectedEntry::~SelectedEntry() build_docker/../src/Storages/MergeTree/ReplicatedMergeTreeQueue.h:351:12
    9 0x268ead1a in void std::__1::__destroy_at<DB::ReplicatedMergeTreeQueue::SelectedEntry, 0>(DB::ReplicatedMergeTreeQueue::SelectedEntry*) build_docker/../contrib/libcxx/include/__memory/construct_at.h:56:13
    ...
    16 0x265e9abb in DB::MergeTreeBackgroundExecutor<DB::MergeMutateRuntimeQueue>::routine(std::__1::shared_ptr<DB::TaskRuntimeData>)::'lambda'()::~() build_docker/../src/Storages/MergeTree/MergeTreeBackgroundExecutor.cpp:127:30
    17 0x265e9abb in DB::MergeTreeBackgroundExecutor<DB::MergeMutateRuntimeQueue>::routine(std::__1::shared_ptr<DB::TaskRuntimeData>) build_docker/../src/Storages/MergeTree/MergeTreeBackgroundExecutor.cpp:235:1
    18 0x265ea730 in DB::MergeTreeBackgroundExecutor<DB::MergeMutateRuntimeQueue>::threadFunction() build_docker/../src/Storages/MergeTree/MergeTreeBackgroundExecutor.cpp:261:13

</details>

  [1]: https://s3.amazonaws.com/clickhouse-test-reports/0/533c7888038453c047df816f3f65292cca05a54f/stateless_tests__ubsan__actions_.html

And I also I think that the following issue will also be fixed [2]:

<details>

<summary>stack trace</summary>

    [ 680 ] {} <Fatal> : Logical error: 'Memory tracker: allocations not allowed.'.
    ...
    [ 23430 ] {} <Fatal> BaseDaemon: 23. /build/build_docker/../src/Common/formatReadable.cpp:46: formatReadableSizeWithBinarySuffix(double, int) @ 0x1713bb98 in /usr/bin/clickhouse
    ...
    [ 23430 ] {} <Fatal> BaseDaemon: 31. ../src/Common/MemoryTracker.cpp:112: MemoryTracker::logPeakMemoryUsage() @ 0x170e0ab9 in /usr/bin/clickhouse
    [ 23430 ] {} <Fatal> BaseDaemon: 32. /build/build_docker/../src/Common/MemoryTracker.cpp:98: MemoryTracker::~MemoryTracker() @ 0x170e063a in /usr/bin/clickhouse
    [ 23430 ] {} <Fatal> BaseDaemon: 33. /build/build_docker/../src/Storages/MergeTree/MergeList.cpp:144: DB::MergeListElement::~MergeListElement() @ 0x279fb290 in /usr/bin/clickhouse
    ...
    [ 23430 ] {} <Fatal> BaseDaemon: 38. /build/build_docker/../src/Storages/MergeTree/BackgroundProcessList.h:41: DB::BackgroundProcessListEntry<DB::MergeListElement, DB::MergeInfo>::~BackgroundProcessListEntry() @ 0x276ce6c7 in /usr/bin/clickhouse
    [ 23430 ] {} <Fatal> BaseDaemon: 39. /build/build_docker/../contrib/libcxx/include/__memory/unique_ptr.h:54: std::__1::default_delete<DB::BackgroundProcessListEntry<DB::MergeListElement, DB::MergeInfo> >::operator()(DB::BackgroundProcessListEntry<DB::MergeListElement, DB::MergeInfo>*) const @ 0x276ce60b in /usr/bin/clickhouse
    [ 23430 ] {} <Fatal> BaseDaemon: 40. /build/build_docker/../contrib/libcxx/include/__memory/unique_ptr.h:316: std::__1::unique_ptr<DB::BackgroundProcessListEntry<DB::MergeListElement, DB::MergeInfo>, std::__1::default_delete<DB::BackgroundProcessListEntry<DB::MergeListElement, DB::MergeInfo> > >::reset(DB::BackgroundProcessListEntry<DB::MergeListElement, DB::MergeInfo>*) @ 0x276ce57c in /usr/bin/clickhouse
    [ 23430 ] {} <Fatal> BaseDaemon: 41. /build/build_docker/../contrib/libcxx/include/__memory/unique_ptr.h:269: std::__1::unique_ptr<DB::BackgroundProcessListEntry<DB::MergeListElement, DB::MergeInfo>, std::__1::default_delete<DB::BackgroundProcessListEntry<DB::MergeListElement, DB::MergeInfo> > >::~unique_ptr() @ 0x276ce399 in /usr/bin/clickhouse
    [ 23430 ] {} <Fatal> BaseDaemon: 42. /build/build_docker/../src/Storages/MergeTree/MutatePlainMergeTreeTask.h:22: DB::MutatePlainMergeTreeTask::~MutatePlainMergeTreeTask() @ 0x27defceb in /usr/bin/clickhouse
    [ 23430 ] {} <Fatal> BaseDaemon: 43. /build/build_docker/../contrib/libcxx/include/__memory/construct_at.h:57: void std::__1::__destroy_at<DB::MutatePlainMergeTreeTask, 0>(DB::MutatePlainMergeTreeTask*) @ 0x27dd69c1 in /usr/bin/clickhouse
    [ 23430 ] {} <Fatal> BaseDaemon: 44. /build/build_docker/../contrib/libcxx/include/__memory/construct_at.h:82: void std::__1::destroy_at<DB::MutatePlainMergeTreeTask, 0>(DB::MutatePlainMergeTreeTask*) @ 0x27dd6955 in /usr/bin/clickhouse
    [ 23430 ] {} <Fatal> BaseDaemon: Integrity check of the executable skipped because the reference checksum could not be read. (calculated checksum: 91F5937571C11255DFE73230B52CE9C0)
    [ 602 ] {} <Fatal> Application: Child process was terminated by signal 6.

</details>

  [2]: https://s3.amazonaws.com/clickhouse-test-reports/39222/a068c397dfd7943359a8b554566c3c70b78baf8d/stateless_tests__debug__actions__%5B1/3%5D.html

Refs: https://github.com/ClickHouse/ClickHouse/pull/29614#discussion_r720455032 (cc @nikitamikhaylov)
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2022-07-18 19:01:41 +03:00
Alexander Tokmakov
bc9c359abe
Update 01174_select_insert_isolation.sh 2022-07-18 18:47:35 +03:00
Alexander Tokmakov
51c4ffad8c block memory exceptions in TransactionLog 2022-07-18 17:40:09 +02:00
avogar
2367f40b70 Better exception messages in schema inference 2022-07-18 15:36:33 +00:00
Alexander Tokmakov
64e2e10e2b
Merge pull request #39318 from ClickHouse/fix_build_clang_13
Fix build clang-13
2022-07-18 18:33:24 +03:00
Alexander Tokmakov
ae96911735 fix flaky 01174_select_insert_isolation 2022-07-18 17:31:36 +02:00
DanRoscigno
362694ea70 switch from mkdocs to Docusaurus 2022-07-18 11:20:53 -04:00
Alexander Tokmakov
225a5c3c7e
Update tests/integration/helpers/cluster.py 2022-07-18 18:19:02 +03:00
Alexander Tokmakov
23312164bf do not start on unexpected Ordinary metadata 2022-07-18 17:05:03 +02:00
Antonio Andelic
cfc741030f Revert to the version with path 2022-07-18 14:30:15 +00:00
Dmitry Novik
855ad30a5d
Merge pull request #39305 from ClickHouse/window-case-test
Add test for window function inside CASE
2022-07-18 16:10:11 +02:00
Alexander Tokmakov
dfccb677f5 try fix flaky test_store_cleanup 2022-07-18 16:03:06 +02:00
Kruglov Pavel
b687b5406e
Fix include and typo 2022-07-18 15:58:39 +02:00
Azat Khuzhin
f187c3499a Fix getauxval() by using procfs with fallback to environ
getauxval() from glibc-compatibility did not work always correctly:

- It does not work after setenv(), and this breaks vsyscalls,
  like sched_getcpu() [1] (and BaseDaemon.cpp always set TZ if timezone
  is defined, which is true for CI [2]).

  Also note, that fixing setenv() will not fix LSan,
  since the culprit is getauxval()

  [1]: https://bugzilla.redhat.com/show_bug.cgi?id=1163404
  [2]: ClickHouse#32928 (comment)

- Another think that is definitely broken is LSan (Leak Sanitizer), it
  relies on worked getauxval() but it does not work if __environ is not
  initialized yet (there is even a commit about this).

  And because of, at least, one leak had been introduced [3]:

    [3]: ClickHouse#33840

Fix this by using /proc/self/auxv with fallback to environ solution to
make it compatible with environment that does not allow reading from
auxv (or no procfs).

v2: add fallback to environ solution
v3: fix return value for __auxv_init_procfs()
Refs: #33957
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2022-07-18 16:49:49 +03:00
Azat Khuzhin
51e7c41883 Add a test for LSan
v2: fix type check
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2022-07-18 16:49:49 +03:00
Kseniia Sumarokova
b4eae94889
Merge pull request #39259 from rnbondarenko/patch-1
removed default queue arguments
2022-07-18 15:32:31 +02:00
Robert Schulze
33aa9593ca
Merge pull request #39265 from jrdi/fix-macosx-endian
Fix macosx compilation due to endian.h
2022-07-18 15:32:17 +02:00
Robert Schulze
e2aa2d9850
Merge pull request #39295 from azat/cmake-cache-fix
Fix running cmake with predefined cache (for development only)
2022-07-18 15:31:18 +02:00
Kruglov Pavel
6f5e0172f4
Fix spaces 2022-07-18 15:30:44 +02:00
Kseniia Sumarokova
a75cead5d0
Merge pull request #39314 from azat/disks-leak
Fix leaking of logger in clickhouse-disks
2022-07-18 15:30:35 +02:00
Robert Schulze
74e55e42f6
Merge pull request #39167 from ClickHouse/multiStringAllPositions-non-const-needle
multiStringAllPositions() with non-const needle
2022-07-18 15:30:14 +02:00
Kruglov Pavel
ae68a641a8
Update src/Core/SettingsChangesHistory.h
Co-authored-by: Vladimir C <vdimir@clickhouse.com>
2022-07-18 15:29:13 +02:00
Vitaly Baranov
ad115a9a3d
Merge pull request #39254 from vitlibar/backup-checks-destination-not-in-use
Check that the destination for a backup is not in use.
2022-07-18 15:19:43 +02:00
avogar
80b5bc5236 Add system table settings_changes 2022-07-18 13:19:41 +00:00