Commit Graph

130358 Commits

Author SHA1 Message Date
Azat Khuzhin
b7edde3621 Shutdown embedded keeper even if it was not started successfully
Since even when it does not, there are still few threads left that
should be joined (request, response, snapshot, snapshot s3):

There are some problems with keeper and invalid config, that got stuck in:

    libc.so.6`___lldb_unnamed_symbol3457 + 231
    libc.so.6`pthread_cond_timedwait + 571
    clickhouse`std::__1::__libcpp_condvar_timedwait[abi:v15000](__cv=0x00007f475c41a708, __m=0x00007f475c41a6b0, __ts=0x00007f45a99f1440) at __threading_support:341:10
    clickhouse`std::__1::condition_variable::__do_timed_wait(this=0x00007f475c41a708, lk=0x00007f45a99f1738, tp=time_point<std::__1::chrono::system_clock, std::__1::chrono::duration<long long, std::__1::ratio<1L, 1000000000L> > > @ 0x00007f45a99f1488) at condition_variable.cpp:76:14
    clickhouse`std::__1::cv_status std::__1::condition_variable::wait_for<long long, std::__1::ratio<1l, 1000000000l> >(this=0x00007f475c41a708, __lk=0x00007f45a99f1738, __d=0x00007f45a99f1590) at __mutex_base:457:9
    clickhouse`void std::__1::condition_variable::__do_timed_wait<std::__1::chrono::steady_clock>(this=0x00007f475c41a708, __lk=0x00007f45a99f1738, __tp=time_point<std::__1::chrono::steady_clock, std::__1::chrono::duration<long long, std::__1::ratio<1L, 1000000000L> > > @ 0x00007f45a99f15a8) at __mutex_base:512:5
    clickhouse`std::__1::cv_status std::__1::condition_variable::wait_until<std::__1::chrono::steady_clock, std::__1::chrono::duration<long long, std::__1::ratio<1l, 1000000000l> > >(this=0x00007f475c41a708, __lk=0x00007f45a99f1738, __t=0x00007f45a99f1698) at __mutex_base:415:5
    clickhouse`bool std::__1::condition_variable::wait_until<std::__1::chrono::steady_clock, std::__1::chrono::duration<long long, std::__1::ratio<1l, 1000000000l> >, bool ConcurrentBoundedQueue<DB::KeeperStorage::RequestForSession>::popImpl<true>(DB::KeeperStorage::RequestForSession&, std::__1::optional<unsigned long>)::'lambda'()>(this=0x00007f475c41a708, __lk=0x00007f45a99f1738, __t=0x00007f45a99f1698, __pred=(unnamed class) @ 0x00007f45a99f1650)::'lambda'()) at __mutex_base:427:13
    clickhouse`bool std::__1::condition_variable::wait_for[abi:v15000]<long long, std::__1::ratio<1l, 1000l>, bool ConcurrentBoundedQueue<DB::KeeperStorage::RequestForSession>::popImpl<true>(DB::KeeperStorage::RequestForSession&, std::__1::optional<unsigned long>)::'lambda'()>(this=0x00007f475c41a708, __lk=0x00007f45a99f1738, __d=0x00007f45a99f1720, __pred=(unnamed class) @ 0x00007f45a99f16b8)::'lambda'()) at __mutex_base:471:12
    clickhouse`bool ConcurrentBoundedQueue<DB::KeeperStorage::RequestForSession>::popImpl<true>(this=0x00007f475c41a680, x=0x00007f45a99f1ba0, timeout_milliseconds= Has Value=true ) at ConcurrentBoundedQueue.h:75:50
    clickhouse`ConcurrentBoundedQueue<DB::KeeperStorage::RequestForSession>::tryPop(this=0x00007f475c41a680, x=0x00007f45a99f1ba0, milliseconds=5000) at ConcurrentBoundedQueue.h:161:16
    clickhouse`DB::KeeperDispatcher::requestThread(this=0x00007f475c8fac18) at KeeperDispatcher.cpp:88:33
    clickhouse`DB::KeeperDispatcher::initialize(this=0x00007f45a99f2020)::$_0::operator()() const at KeeperDispatcher.cpp:349:52
    clickhouse`decltype(__f=0x00007f45a99f2020)::$_0&>()()) std::__1::__invoke[abi:v15000]<DB::KeeperDispatcher::initialize(Poco::Util::AbstractConfiguration const&, bool, bool, std::__1::shared_ptr<DB::Macros const> const&)::$_0&>(DB::KeeperDispatcher::initialize(Poco::Util::AbstractConfiguration const&, bool, bool, std::__1::shared_ptr<DB::Macros const> const&)::$_0&) at invoke.h:394:23
    clickhouse`decltype(__f=0x00007f45a99f2020, __t=size=0, (null)=__tuple_indices<> @ 0x00007f45a99f1d28) std::__1::__apply_tuple_impl[abi:v15000]<DB::KeeperDispatcher::initialize(Poco::Util::AbstractConfiguration const&, bool, bool, std::__1::shared_ptr<DB::Macros const> const&)::$_0&, std::__1::tuple<>&>(DB::KeeperDispatcher::initialize(Poco::Util::AbstractConfiguration const&, bool, bool, std::__1::shared_ptr<DB::Macros const> const&)::$_0&, std::__1::tuple<>&, std::__1::__tuple_indices<>) at tuple:1789:1
    clickhouse`decltype(__f=0x00007f45a99f2020, __t=size=0) std::__1::apply[abi:v15000]<DB::KeeperDispatcher::initialize(Poco::Util::AbstractConfiguration const&, bool, bool, std::__1::shared_ptr<DB::Macros const> const&)::$_0&, std::__1::tuple<>&>(DB::KeeperDispatcher::initialize(Poco::Util::AbstractConfiguration const&, bool, bool, std::__1::shared_ptr<DB::Macros const> const&)::$_0&, std::__1::tuple<>&) at tuple:1798:1
    clickhouse`ThreadFromGlobalPoolImpl<true>::ThreadFromGlobalPoolImpl<DB::KeeperDispatcher::initialize(this=0x00007f475c9703c0)::$_0>(DB::KeeperDispatcher::initialize(Poco::Util::AbstractConfiguration const&, bool, bool, std::__1::shared_ptr<DB::Macros const> const&)::$_0&&)::'lambda'()::operator()() at ThreadPool.h:245:13
    clickhouse`decltype(__f=0x00007f475c9703c0)::$_0>()()) std::__1::__invoke[abi:v15000]<ThreadFromGlobalPoolImpl<true>::ThreadFromGlobalPoolImpl<DB::KeeperDispatcher::initialize(Poco::Util::AbstractConfiguration const&, bool, bool, std::__1::shared_ptr<DB::Macros const> const&)::$_0>(DB::KeeperDispatcher::initialize(Poco::Util::AbstractConfiguration const&, bool, bool, std::__1::shared_ptr<DB::Macros const> const&)::$_0&&)::'lambda'()&>(DB::KeeperDispatcher::initialize(Poco::Util::AbstractConfiguration const&, bool, bool, std::__1::shared_ptr<DB::Macros const> const&)::$_0&&) at invoke.h:394:23
    clickhouse`void std::__1::__invoke_void_return_wrapper<void, true>::__call<ThreadFromGlobalPoolImpl<true>::ThreadFromGlobalPoolImpl<DB::KeeperDispatcher::initialize(__args=0x00007f475c9703c0)::$_0>(DB::KeeperDispatcher::initialize(Poco::Util::AbstractConfiguration const&, bool, bool, std::__1::shared_ptr<DB::Macros const> const&)::$_0&&)::'lambda'()&>(ThreadFromGlobalPoolImpl<true>::ThreadFromGlobalPoolImpl<DB::KeeperDispatcher::initialize(Poco::Util::AbstractConfiguration const&, bool, bool, std::__1::shared_ptr<DB::Macros const> const&)::$_0>(DB::KeeperDispatcher::initialize(Poco::Util::AbstractConfiguration const&, bool, bool, std::__1::shared_ptr<DB::Macros const> const&)::$_0&&)::'lambda'()&) at invoke.h:479:9
    clickhouse`std::__1::__function::__default_alloc_func<ThreadFromGlobalPoolImpl<true>::ThreadFromGlobalPoolImpl<DB::KeeperDispatcher::initialize(Poco::Util::AbstractConfiguration const&, bool, bool, std::__1::shared_ptr<DB::Macros const> const&)::$_0>(DB::KeeperDispatcher::initialize(Poco::Util::AbstractConfiguration const&, bool, bool, std::__1::shared_ptr<DB::Macros const> const&)::$_0&&)::'lambda'(), void ()>::operator(this=0x00007f475c9703c0)[abi:v15000]() at function.h:235:12
    clickhouse`void std::__1::__function::__policy_invoker<void ()>::__call_impl<std::__1::__function::__default_alloc_func<ThreadFromGlobalPoolImpl<true>::ThreadFromGlobalPoolImpl<DB::KeeperDispatcher::initialize(__buf=0x00007f45a99f22d8)::$_0>(DB::KeeperDispatcher::initialize(Poco::Util::AbstractConfiguration const&, bool, bool, std::__1::shared_ptr<DB::Macros const> const&)::$_0&&)::'lambda'(), void ()> >(std::__1::__function::__policy_storage const*) at function.h:716:16
    clickhouse`std::__1::__function::__policy_func<void ()>::operator(this=0x00007f45a99f22d8)[abi:v15000]() const at function.h:848:16
    clickhouse`std::__1::function<void ()>::operator(this=0x00007f45a99f22d8)() const at function.h:1187:12
    clickhouse`ThreadPoolImpl<std::__1::thread>::worker(this=0x00007f475c8229c0, thread_it=std::__1::list<std::__1::thread, std::__1::allocator<std::__1::thread> >::iterator @ 0x00007f45a99f23a8) at ThreadPool.cpp:427:13
    clickhouse`void ThreadPoolImpl<std::__1::thread>::scheduleImpl<void>(this=0x00007f45cea0c8a8)>, Priority, std::__1::optional<unsigned long>, bool)::'lambda0'()::operator()() const at ThreadPool.cpp:180:73
    clickhouse`decltype(__f=0x00007f45cea0c8a8)()) std::__1::__invoke[abi:v15000]<void ThreadPoolImpl<std::__1::thread>::scheduleImpl<void>(std::__1::function<void ()>, Priority, std::__1::optional<unsigned long>, bool)::'lambda0'()>(void&&) at invoke.h:394:23
    clickhouse`void std::__1::__thread_execute[abi:v15000]<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, void ThreadPoolImpl<std::__1::thread>::scheduleImpl<void>(std::__1::function<void ()>, Priority, std::__1::optional<unsigned long>, bool)::'lambda0'()>(__t=size=2, (null)=__tuple_indices<> @ 0x00007f45a99f2408)>, Priority, std::__1::optional<unsigned long>, bool)::'lambda0'()>&, std::__1::__tuple_indices<>) at thread:284:5
    clickhouse`void* std::__1::__thread_proxy[abi:v15000]<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, void ThreadPoolImpl<std::__1::thread>::scheduleImpl<void>(std::__1::function<void ()>, Priority, std::__1::optional<unsigned long>, bool)::'lambda0'()> >(__vp=0x00007f45cea0c8a0) at thread:295:5
    libc.so.6`___lldb_unnamed_symbol3481 + 755
    libc.so.6`___lldb_unnamed_symbol3865 + 11

This should fix the problem with
test_keeper_incorrect_config/test.py::test_invalid_configs test.

CI: https://s3.amazonaws.com/clickhouse-test-reports/52717/72b1052f7c2d453308262924e767ab8dc2206933/integration_tests__asan__[1_6].html
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2023-12-09 17:54:16 +01:00
Azat Khuzhin
55d5a3affa Correctly wait background threads
There are some places that make it possible to trigger use-after-free
from threads because some global variable had been destroyed before, for
example some logger.

Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2023-12-09 17:54:16 +01:00
Alexey Milovidov
7e61bce8e5
Merge pull request #57706 from ClickHouse/deprecate-live-view-2
Deprecate LIVE VIEW
2023-12-09 17:43:00 +01:00
Alexey Milovidov
c77183a597
Merge pull request #57480 from azat/dist/async-INSERT-fixes
Fix possible distributed sends stuck due to "No such file or directory" (during recovering batch from disk)
2023-12-09 17:11:35 +01:00
Alexey Milovidov
56cd9196b0
Merge pull request #57641 from azat/system.stack_trace-fix
Avoid hangs of system.stack_trace by correctly prohibit parallel read from it
2023-12-09 17:07:48 +01:00
Alexey Milovidov
0d1bdff347 Deprecate LIVE VIEW 2023-12-09 16:57:42 +01:00
Alexey Milovidov
41f126eba0
Merge pull request #57694 from ClickHouse/revert-57229-revert-57222-update-sentry
Revert "Revert "Update Sentry""
2023-12-09 15:17:31 +01:00
Kseniia Sumarokova
69adfffa02
Merge pull request #57588 from ClickHouse/materialized-postgres-escape-publication
Add a test for #55251
2023-12-09 12:14:28 +01:00
Alexey Milovidov
89cce44814 Cut useless code 2023-12-08 23:20:20 +01:00
Nikolay Degterinsky
c5e52d260f
Merge pull request #57553 from evillique/fix-local-crash
Fix crash in clickhouse-local
2023-12-08 22:57:52 +01:00
Alexey Milovidov
f5451d181c
Merge pull request #57698 from ClickHouse/alexey-milovidov-patch-8
Update build-cross-osx.md
2023-12-08 22:35:28 +01:00
Alexey Milovidov
00aca9a3d4
Merge pull request #57634 from ClickHouse/fix-logs-and-exceptions-messages-formatting-4
Fix "logs and exception messages formatting", part 4
2023-12-08 22:02:02 +01:00
Alexey Milovidov
2a77c3a2ff
Merge pull request #57633 from ClickHouse/fix-logs-and-exceptions-messages-formatting-3
Fix "logs and exception messages formatting", part 3
2023-12-08 22:00:29 +01:00
Alexey Milovidov
98b7130400
Merge pull request #57632 from ClickHouse/fix-logs-and-exceptions-messages-formatting-2
Fix "logs and exception messages formatting", part 2
2023-12-08 21:59:37 +01:00
Alexey Milovidov
407761d67c
Merge pull request #57630 from ClickHouse/fix-logs-and-exceptions-messages-formatting-1
Fix "logs and exception messages formatting", part 1
2023-12-08 21:58:38 +01:00
Alexey Milovidov
9c4a1ff63e
Merge pull request #57640 from ClickHouse/remove-bad-test-7
Remove bad test (4)
2023-12-08 21:56:51 +01:00
Alexey Milovidov
c97d33abf9
Merge pull request #57639 from ClickHouse/remove-bad-test-6
Remove bad test (3)
2023-12-08 21:56:14 +01:00
Alexey Milovidov
b31ed68a3b
Merge pull request #57637 from ClickHouse/remove-bad-test-5
Remove bad test (2)
2023-12-08 21:55:31 +01:00
Alexey Milovidov
e31ff60daf
Merge pull request #57636 from ClickHouse/remove-bad-test-4
Remove bad test (1)
2023-12-08 21:55:12 +01:00
Alexey Milovidov
bb084466c4
Update build-cross-osx.md 2023-12-08 23:51:12 +03:00
Alexey Milovidov
d9520eefb5
Revert "Revert "Update Sentry"" 2023-12-08 22:53:09 +03:00
Alexey Milovidov
ba5ff075bb
Merge pull request #57624 from yariks5s/date_trunc_case_insensitive_arguments
Case-insensitive arguments for `date_trunc()`
2023-12-08 16:37:49 +01:00
Azat Khuzhin
b1043b7ad3 Increase log verbosity of some messages in system.stack_trace
This can help to debug 01051_system_stack_trace test failures.

Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2023-12-08 16:18:49 +01:00
Alexey Milovidov
852880c130
Merge pull request #57643 from ClickHouse/more-tests-jit
Merge half of #51113
2023-12-08 16:15:30 +01:00
alesapin
dc7347e0ba
Merge pull request #57271 from hanfei1991/hanfei/keeper_soft_limit
support memory soft limit for keeper
2023-12-08 16:12:47 +01:00
Kseniia Sumarokova
d0c5dd3b87
Merge branch 'master' into materialized-postgres-escape-publication 2023-12-08 15:29:10 +01:00
zhongyuankai
7b0f8d44e8
Make DirectoryMonitor handle cluster node list change (#42826) 2023-12-08 14:41:51 +01:00
Mikhail f. Shiryaev
bb2b71674c
Merge pull request #57669 from ClickHouse/pinned-alpine-integration-helper
Pin alpine version of integration tests helper container
2023-12-08 14:27:32 +01:00
Mikhail f. Shiryaev
8bcc4b879c
Pin alpine version of integration tests helper container 2023-12-08 14:15:28 +01:00
Vitaly Baranov
252de64af3
Merge pull request #57362 from aiven-sal/aiven-sal/dict_fix
Prevent dictionary's ACL bypass via dictionary() table function
2023-12-08 14:09:40 +01:00
Mikhail f. Shiryaev
f26e31357d
Merge pull request #57572 from ClickHouse/tune_ci_autoscaling
Tune CI scale up/down multipliers
2023-12-08 13:28:44 +01:00
alesapin
11b90f8dd4
Merge pull request #57626 from ClickHouse/better_exception
Throw more clear exception
2023-12-08 12:03:14 +01:00
Kseniia Sumarokova
f41d3be4b2
Fix bad merge 2023-12-08 11:28:14 +01:00
Azat Khuzhin
16cbcf700e Prohibit parallel read from system.stack_trace
Before rewriting system.stack_trace to handle max_block_size (in #54946)
parallel reading from system.stack_trace was prohibited, because this
could lead to hang of system.stack_trace table.

But that rewrite broke this guarantee, so let's fix it to avoid possible
hung.

Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2023-12-08 11:05:25 +01:00
Kseniia Sumarokova
de7abe2341
Merge branch 'master' into materialized-postgres-escape-publication 2023-12-08 10:53:39 +01:00
Kseniia Sumarokova
1ec2d29302
Merge pull request #57567 from ClickHouse/kssenii-patch-8
Fix possible segfault in PostgreSQLSource
2023-12-08 10:51:08 +01:00
vdimir
6df715f5d7
Merge pull request #57627 from ClickHouse/prometheus-all-errors
Expose the total number of errors to Prometheus endpoint
2023-12-08 10:42:01 +01:00
Max K
a12c685015
Update tests/ci/autoscale_runners_lambda/test_autoscale.py
Co-authored-by: Mikhail f. Shiryaev <felixoid@clickhouse.com>
2023-12-08 10:40:16 +01:00
vdimir
86bdd883f4
Merge pull request #57622 from ClickHouse/vdimir/analyzer_multiif_logical_err
Analyzer: Fix logical error in MultiIfToIfPass
2023-12-08 10:28:55 +01:00
robot-clickhouse
2d134fd120
Merge pull request #57612 from danipozo/fix-reading-s3-script-backupview
Fix parsing virtual hosted S3 URI in clickhouse_backupview script
2023-12-08 10:17:12 +01:00
Alexey Milovidov
845960cc31 Leave only one test for now 2023-12-08 03:28:21 +01:00
Alexey Milovidov
e28dc5d61c Merge branch 'master' into disable-jit 2023-12-08 03:27:29 +01:00
Alexey Milovidov
f5f28208cb
Merge pull request #57618 from myrrc/fix/psql-sigabrt
Fix sigabrt while getting PostgreSQL table structure
2023-12-07 23:42:02 +01:00
Alexey Milovidov
57c79ecd6a Remove bad test (4) 2023-12-07 22:25:29 +01:00
Alexey Milovidov
2c86d7db71 Remove bad test (3) 2023-12-07 22:20:39 +01:00
Alexey Milovidov
84f5179345 Remove bad test 2023-12-07 22:16:50 +01:00
Alexey Milovidov
43ddf349b6 Remove bad test 2023-12-07 22:10:33 +01:00
Alexey Milovidov
5dcdbf499b Fix "logs and exception messages formatting", part 4 2023-12-07 22:04:48 +01:00
Alexey Milovidov
0ee13fde16 Fix "logs and exception messages formatting", part 3 2023-12-07 22:01:53 +01:00
Alexey Milovidov
81e0d081a2 Fix "logs and exception messages formatting", part 2 2023-12-07 21:48:43 +01:00