Commit Graph

470 Commits

Author SHA1 Message Date
Kruglov Pavel
dbba752398
Merge branch 'master' into stress-test 2022-03-04 18:33:37 +03:00
mergify[bot]
c90d24e10b
Merge branch 'master' into random-settings 2022-03-03 13:07:12 +00:00
Maksim Kita
7d90afb3b0
Merge pull request #34988 from azat/safe-exit
Fix signal-unsafe TSan report in client
2022-03-03 09:21:26 +01:00
Azat Khuzhin
a0e590ae6c Fix signal-unsafe TSan report in client
CI founds [1]:

    WARNING: ThreadSanitizer: signal-unsafe call inside of a signal (pid=2975)
        0 malloc  (clickhouse+0xab36d8d)
        1 _dl_exception_create_format  (ld-linux-x86-64.so.2+0x18ea8)
        2 DB::interruptSignalHandler(int) obj-x86_64-linux-gnu/../src/Client/ClientBase.cpp:236:9 (clickhouse+0x1a1d603e)
        3 __tsan::CallUserSignalHandler(__tsan::ThreadState*, bool, bool, bool, int, __sanitizer::__sanitizer_siginfo*, void*) crtstuff.c (clickhouse+0xab3ee5f)
        4 unsigned long std::__1::__cxx_atomic_load(std::__1::__cxx_atomic_base_impl const*, std::__1::memory_order) obj-x86_64-linux-gnu/../contrib/libcxx/include/atomic:1006:12 (clickhouse+0x1da6c41d)
        5 std::__1::__atomic_base::load(std::__1::memory_order) const obj-x86_64-linux-gnu/../contrib/libcxx/include/atomic:1615:17 (clickhouse+0x1da6c41d)
        6 cctz::TimeZoneInfo::MakeTime(cctz::detail::civil_time const&) const obj-x86_64-linux-gnu/../contrib/cctz/src/time_zone_info.cc:844:47 (clickhouse+0x1da6c41d)
        7 cctz::time_zone::Impl::MakeTime(cctz::detail::civil_time const&) const obj-x86_64-linux-gnu/../contrib/cctz/src/time_zone_impl.h:57:19 (clickhouse+0x1da64777)
        8 cctz::time_zone::lookup(cctz::detail::civil_time const&) const obj-x86_64-linux-gnu/../contrib/cctz/src/time_zone_lookup.cc:72:27 (clickhouse+0x1da64777)
        9 DateLUTImpl::DateLUTImpl(std::__1::basic_string, std::__1::allocator > const&) obj-x86_64-linux-gnu/../src/Common/DateLUTImpl.cpp:70:63 (clickhouse+0xac8910b)
        10 DateLUT::getImplementation(std::__1::basic_string, std::__1::allocator > const&) const obj-x86_64-linux-gnu/../src/Common/DateLUT.cpp:155:55 (clickhouse+0xac87404)
        11 DateLUT::DateLUT() obj-x86_64-linux-gnu/../src/Common/DateLUT.cpp:145:25 (clickhouse+0xac8697f)
        12 DateLUT::getInstance() obj-x86_64-linux-gnu/../src/Common/DateLUT.cpp:162:20 (clickhouse+0xac87530)
        13 DateLUT::instance(std::__1::basic_string, std::__1::allocator > const&) obj-x86_64-linux-gnu/../src/Common/DateLUT.h:29:33 (clickhouse+0x188481f9)
        14 TimezoneMixin::TimezoneMixin(std::__1::basic_string, std::__1::allocator > const&) obj-x86_64-linux-gnu/../src/DataTypes/TimezoneMixin.h:18:21 (clickhouse+0x188481f9)
        15 DB::DataTypeDateTime::DataTypeDateTime(std::__1::basic_string, std::__1::allocator > const&) obj-x86_64-linux-gnu/../src/DataTypes/DataTypeDateTime.cpp:11:7 (clickhouse+0x18847e55)
        16 DB::(anonymous namespace)::FunctionEmptyArray::getNameImpl() emptyArray.cpp (clickhouse+0x1602abb1)
        17 DB::registerFunctionsEmptyArray(DB::FunctionFactory&)  (clickhouse+0x16023b6f)
        18 DB::registerFunctionsArray(DB::FunctionFactory&)  (clickhouse+0x15de7b99)
        19 DB::registerFunctions()  (clickhouse+0xe4e7bc6)
        20 DB::Client::main(std::__1::vector, std::__1::allocator >, std::__1::allocator, std::__1::allocator > > > const&) obj-x86_64-linux-gnu/../programs/client/Client.cpp:402:5 (clickhouse+0xacb2649)
        21 Poco::Util::Application::run() obj-x86_64-linux-gnu/../contrib/poco/Util/src/Application.cpp:334:8 (clickhouse+0x1d96868a)
        22 mainEntryClickHouseClient(int, char**) obj-x86_64-linux-gnu/../programs/client/Client.cpp:1237:23 (clickhouse+0xacbdd7c)
        23 main obj-x86_64-linux-gnu/../programs/main.cpp:378:12 (clickhouse+0xabae77a)

  [1]: https://s3.amazonaws.com/clickhouse-test-reports/34924/66cbb468eb6990b74ef4d08beefbe48d32bf4bd5/stateless_tests__thread__actions__[1/3].html

Fixes: #34923
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2022-03-02 22:17:17 +03:00
Maksim Kita
b1a956c5f1 clang-tidy check performance-move-const-arg fix 2022-03-02 18:15:27 +00:00
Kruglov Pavel
3b92b9037f
Merge branch 'master' into random-settings 2022-03-02 21:09:48 +03:00
avogar
d25d83580a Fix tests 2022-03-02 16:33:21 +00:00
mergify[bot]
8014cdf9d3
Merge branch 'master' into random-settings 2022-02-28 14:06:22 +00:00
Azat Khuzhin
f66ad2ee48 Stop processing multiqueries in clickhouse-client/local on SIGINT
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2022-02-28 12:19:13 +03:00
Azat Khuzhin
895c40686c Tiny cleanup of ClientBase
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2022-02-28 12:19:13 +03:00
Azat Khuzhin
067df156eb Use proper exit value on exit by signal (like in glibc)
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2022-02-28 12:19:13 +03:00
Azat Khuzhin
9b753c84f0 Print only total profile events for --profile-events-delay-ms=-1
There was serveral issues:
1) there can be events for multiple threads in one block
2) lack of filter for thread_id = 0
3) thread_id was included into comparator

Fixes: #34719
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2022-02-19 13:49:41 +03:00
Kruglov Pavel
e77319bf01
Merge branch 'master' into stress-test 2022-02-17 20:28:46 +03:00
avogar
1e797c1a8f Fix some tests 2022-02-16 15:10:02 +00:00
Kruglov Pavel
adf58ea1ce
Merge pull request #34490 from Avogar/fix-client
Refactor client fault tolerant connection
2022-02-16 12:39:46 +03:00
Nikita Mikhaylov
e1b0c715fa Done 2022-02-15 15:39:59 +00:00
Kruglov Pavel
a4f5610764
Merge pull request #34476 from CurtizJ/avoid-settings-copy
Avoid unnecessary copying of `Settings`
2022-02-10 14:13:46 +03:00
avogar
372e1f2013 Fix test 2022-02-10 14:06:32 +03:00
avogar
75c56163a0 Refactor client fault tolerant connection 2022-02-10 12:43:08 +03:00
Anton Popov
298838f891 avoid unnecessary copying of Settings 2022-02-10 12:13:51 +03:00
DF5HSE
c08bc7ad65 Merge branch 'master' of github.com:ClickHouse/ClickHouse into client-fault-tolerant-connection 2022-02-08 11:37:31 +03:00
DF5HSE
c1df291b18 Fix error with IPv6 in host param 2022-02-08 02:03:41 +03:00
DF5HSE
87933e44d6 Fix codestyle 2022-02-08 02:03:40 +03:00
DF5HSE
b035ad7843 Fix error with IPv6 in host param and impove HostPort reading from input stream 2022-02-08 02:03:39 +03:00
DF5HSE
3cb433762b Fix errors in build check 2022-02-08 02:03:39 +03:00
DF5HSE
18a777cc8b Add function which gets port from configuration 2022-02-08 02:03:37 +03:00
DF5HSE
69e535fcb2 Merge branch 'master' of github.com:ClickHouse/ClickHouse into client-fault-tolerant-connection 2022-02-08 02:03:36 +03:00
DF5HSE
e780c1292d Add tests, remove saving host in config 2022-02-08 02:03:35 +03:00
DF5HSE
03b4945704 Fix codestyle 2022-02-08 02:03:35 +03:00
kssenii
e41a895ebb Fix 2022-02-06 16:11:18 +01:00
Kseniia Sumarokova
4dee6488f9
Merge pull request #34265 from kssenii/add-query-id-for-client-queries-file
print query id when using `--interactive` with `--queries-file` in client/local
2022-02-05 17:23:33 +01:00
alexey-milovidov
768c71c1ac
Update ClientBase.cpp 2022-02-03 05:13:48 +03:00
Anton Popov
5bb1b3ce77 support async inserts in clickhouse-client for queries with inlined data 2022-02-02 20:59:37 +03:00
kssenii
eae0bc7c04 add query id for delayed interactive 2022-02-02 18:20:59 +03:00
Sergei Trifonov
68bc456830
Merge pull request #34223 from azat/bump-fmt
Bump fmtlib from 7.0.0 to 8.1.1
2022-02-02 00:03:25 +03:00
Azat Khuzhin
bedf208cbd Use fmt::runtime() for LOG_* for non constexpr
Here is oneliner:

    $ gg 'LOG_\(DEBUG\|TRACE\|INFO\|TEST\|WARNING\|ERROR\|FATAL\)([^,]*, [a-zA-Z]' -- :*.cpp :*.h | cut -d: -f1 | sort -u | xargs -r sed -E -i 's#(LOG_[A-Z]*)\(([^,]*), ([A-Za-z][^,)]*)#\1(\2, fmt::runtime(\3)#'

Note, that I tried to do this with coccinelle (tool for semantic
patchin), but it cannot parse C++:

    $ cat fmt.cocci
    @@
    expression log;
    expression var;
    @@

    -LOG_DEBUG(log, var)
    +LOG_DEBUG(log, fmt::runtime(var))

I've also tried to use some macros/templates magic to do this implicitly
in logger_useful.h, but I failed to do so, and apparently it is not
possible for now.

Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>

v2: manual fixes
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2022-02-01 14:30:03 +03:00
Amos Bird
bb34435928
Better code 2022-01-30 19:48:35 +08:00
Amos Bird
54517753d7
Combining our lexer with replxx 2022-01-30 19:48:33 +08:00
Kruglov Pavel
b54bf18b27
Merge branch 'master' into stress-test 2022-01-25 14:35:42 +03:00
Azat Khuzhin
1acd644040 Add inplace merge for new completion words
This will allow:
- use addWords() everywhere
- remove that optimization for empty words case (initial load)
- and now we remove duplicates according to comparator

v2: replace parameter pack in addWords() with explicit Compare for both
cases (just pass default)
2022-01-24 22:59:18 +03:00
Kruglov Pavel
175788ecf9
Merge pull request #33790 from Avogar/fix-input
Fix bug in client that led to 'Connection reset by peer' in server
2022-01-20 14:09:13 +03:00
Azat Khuzhin
3e58094bcb Fix build w/o replxx 2022-01-20 10:02:02 +03:00
DF5HSE
b46af3e0c4 Add list of '<host>:[<port>]' reading in --host param 2022-01-20 00:36:18 +03:00
DF5HSE
f6d50f6fd3 Add list of hosts reading 2022-01-20 00:15:11 +03:00
avogar
6092ed48bd Fix bug in client that led to 'Connection reset by peer' in server 2022-01-19 19:04:57 +03:00
Azat Khuzhin
f12e4b6ef7 Rewrite suggestions to make it more cleaner
- use plain mutex over atomic
- use addWords() for initial suggestion filling
- return vector<> from getCompletions() over iterator, to avoid possible
  questions (even though it was safe, since addWords() could not be
  called in parallel with getCompletions() before)
2022-01-18 21:03:51 +03:00
Kruglov Pavel
d2e9f37bee
Merge branch 'master' into format-by-extention 2022-01-14 18:36:23 +03:00
avogar
817a314263 Fix tests and style 2022-01-14 17:46:24 +03:00
tavplubix
8c9a369588
Merge pull request #33535 from kssenii/fix-local-client-exception
Fix clickhouse local interactive exception case
2022-01-12 13:17:05 +03:00
kssenii
211f1dd482 Fix 2022-01-12 00:28:53 +03:00