Commit Graph

44589 Commits

Author SHA1 Message Date
alesapin
4ab5edadb7 Less libraries 2020-07-10 12:47:50 +03:00
BohuTANG
86590d4aca Change the exception catch to the generic way 2020-07-10 17:18:00 +08:00
Azat Khuzhin
610382b693 kafka: fix SIGSEGV if there is an message with error in the middle of the batch
ReadBufferFromKafkaConsumer does not handle the case when there is
message with an error on non first position in the current batch, since
it goes through messages in the batch after poll and stop on first valid
message.

But later it can try to use message as valid:
- while storing offset
- get topic name
- ...

And besides the message itself is also invalid (you can find this in the
gdb traces below).

So just filter out messages win an error error after poll.

SIGSEGV was with the following stacktrace:
    (gdb) bt
    3  0x0000000010f05b4d in rd_kafka_offset_store (app_rkt=0x0, partition=0, offset=0) at ../contrib/librdkafka/src/rdkafka_offset.c:656
    4  0x0000000010e69657 in cppkafka::Consumer::store_offset (this=0x7f2015210820, msg=...) at ../contrib/cppkafka/include/cppkafka/message.h:225
    5  0x000000000e68f208 in DB::ReadBufferFromKafkaConsumer::storeLastReadMessageOffset (this=0x7f206a136618) at ../contrib/libcxx/include/iterator:1508
    6  0x000000000e68b207 in DB::KafkaBlockInputStream::readImpl (this=0x7f202c689020) at ../src/Storages/Kafka/KafkaBlockInputStream.cpp:150
    7  0x000000000dd1178d in DB::IBlockInputStream::read (this=this@entry=0x7f202c689020) at ../src/DataStreams/IBlockInputStream.cpp:60
    8  0x000000000dd34c0a in DB::copyDataImpl<> () at ../src/DataStreams/copyData.cpp:21
    9  DB::copyData () at ../src/DataStreams/copyData.cpp:62
    10 0x000000000e67c8f2 in DB::StorageKafka::streamToViews () at ../contrib/libcxx/include/memory:3823
    11 0x000000000e67d218 in DB::StorageKafka::threadFunc () at ../src/Storages/Kafka/StorageKafka.cpp:488

And some information from it:

    (gdb) p this.current.__i
    $14 = (std::__1::__wrap_iter<cppkafka::Message const*>::iterator_type) 0x7f1ca8f58660

    # current-1
    (gdb) p $14-1
    $15 = (const cppkafka::Message *) 0x7f1ca8f58600
    (gdb) p $16.handle_
    $17 = {__ptr_ = {<std::__1::__compressed_pair_elem<rd_kafka_message_s*, 0, false>> = { __value_ = 0x7f203577f938}, ...}
    (gdb) p *(rd_kafka_message_s*)0x7f203577f938
    $24 = {err = RD_KAFKA_RESP_ERR__TRANSPORT, rkt = 0x0, partition = 0, payload = 0x7f202f0339c0, len = 63, key = 0x0, key_len = 0, offset = 0, _private = 0x7f203577f8c0}

    # current
    (gdb) p $14-0
    $28 = (const cppkafka::Message *) 0x7f1ca8f58660
    (gdb) p $28.handle_.__ptr_
    $29 = {<std::__1::__compressed_pair_elem<rd_kafka_message_s*, 0, false>> = { __value_ = 0x7f184f129bf0}, ...}
    (gdb) p *(rd_kafka_message_s*)0x7f184f129bf0
    $30 = {err = RD_KAFKA_RESP_ERR_NO_ERROR, rkt = 0x7f1ed44fe000, partition = 1, payload = 0x7f1fc9bc6036, len = 242, key = 0x0, key_len = 0, offset = 2394853582209,

    # current+1
    (gdb) p (*($14+1)).handle_.__ptr_
    $44 = {<std::__1::__compressed_pair_elem<rd_kafka_message_s*, 0, false>> = { __value_ = 0x7f184f129d30}, ...}
    (gdb) p *(rd_kafka_message_s*)0x7f184f129d30
    $45 = {err = RD_KAFKA_RESP_ERR_NO_ERROR, rkt = 0x7f1ed44fe000, partition = 1, payload = 0x7f1fc9bc612f, len = 31, key = 0x0, key_len = 0, offset = 2394853582210,
      _private = 0x7f184f129cc0}

    # distance from the beginning
    (gdb) p messages.__end_-messages.__begin_
    $34 = 65536
    (gdb) p ($14-0)-messages.__begin_
    $37 = 8965
    (gdb) p ($14-1)-messages.__begin_
    $38 = 8964

    # parsing info
    (gdb) p allowed
    $39 = false
    (gdb) p new_rows
    $40 = 1
    (gdb) p total_rows
    $41 = 8964

    # current buffer is invalid
    (gdb) p *buffer.__ptr_
    $50 = {<DB::ReadBuffer> = {<DB::BufferBase> = {pos = 0x7f202f0339c0 "FindCoordinator response error: Local: Broker transport failure", bytes = 47904863385, working_buffer = {
            begin_pos = 0x7f202f0339c0 "FindCoordinator response error: Local: Broker transport failure",
            end_pos = 0x7f202f0339c0 "FindCoordinator response error: Local: Broker transport failure"}, internal_buffer = {

v0: check message errors in ReadBufferFromKafkaConsumer::nextImpl() (but
this may lead to using of that messages after and SIGSEGV again, doh).
v2: skip messages with an error after poll.
2020-07-10 11:41:44 +03:00
Alexey Milovidov
47eaffbe63 Additional checks 2020-07-10 11:21:40 +03:00
Alexey Milovidov
4b86f36d37 Check arguments of bloom filter index 2020-07-10 11:13:21 +03:00
alesapin
5cae87e664
Merge pull request #12335 from ClickHouse/fix_alter_exit_codes
Fix alter rename error messages
2020-07-10 11:05:20 +03:00
Alexey Milovidov
d543a75f65 Allow to parse operator NOT as a function #12262 2020-07-10 09:48:05 +03:00
Alexey Milovidov
02dea4973d Allow to parse operator NOT as a function #12262 2020-07-10 09:47:37 +03:00
Alexey Milovidov
276b3a0215 Avoid exception when negative or floating point constant is used in WHERE condition for indexed tables #11905 2020-07-10 09:30:49 +03:00
BohuTANG
dfd7c5300a Add test_mysql_client_exception integration test 2020-07-10 14:20:32 +08:00
Alexey Milovidov
a4c68a47d5 Added failing test with clearing all columns 2020-07-10 08:58:16 +03:00
Alexey Milovidov
a4b35a8a6f Allow to CLEAR column even if there are depending DEFAULT expressions #12333 2020-07-10 08:54:35 +03:00
Alexey Milovidov
df2c7fec24 Add comment 2020-07-10 08:42:09 +03:00
alexey-milovidov
c16d8e094b
Merge pull request #12308 from ClickHouse/fix-codec-bad-exception-code
Fix wrong exception code in codecs Delta, DoubleDelta #12110
2020-07-10 08:40:46 +03:00
alexey-milovidov
6479e2b406
Update FieldVisitors.h 2020-07-10 08:37:43 +03:00
Alexey Milovidov
70273725d5 Fix error 2020-07-10 08:30:54 +03:00
Alexey Milovidov
c610a4b0a8 Fix error with ownership of aggregate function states with nested states 2020-07-10 08:28:34 +03:00
alexey-milovidov
c5ebf596c8
Merge pull request #12315 from ClickHouse/fix-race-condition-replicated-merge-tree-queue
Fix race condition in ReplicatedMergeTreeQueue
2020-07-10 08:11:56 +03:00
BohuTANG
64fdce9398 Write through Poco::Exception exception to MySQL protocol client 2020-07-10 12:54:08 +08:00
alexey-milovidov
8d7e418617
Merge pull request #12314 from BohuTANG/mysql_select_database
Support MySQL 'SELECT DATABASE()'
2020-07-10 06:32:04 +03:00
Alexey Milovidov
12e00411b4 Fix TOTALS/ROLLUP/CUBE for aggregate functions with -State and Nullable arguments #12163 2020-07-10 06:23:42 +03:00
Alexey Milovidov
f252dd94c8 Miscellaneous 2020-07-10 05:17:15 +03:00
Alexey Milovidov
fcdcb3cb1e Remove useless code 2020-07-10 04:58:27 +03:00
Alexey Milovidov
afc00fa0b8 Merge branch 'master' into fix-codec-bad-exception-code 2020-07-10 04:12:24 +03:00
Alexey Milovidov
7fc90aa070 Fix error 2020-07-10 02:45:29 +03:00
Alexey Milovidov
ad6fcd57b2 Merge branch 'master' into fix-race-condition-replicated-merge-tree-queue 2020-07-10 02:21:24 +03:00
alexey-milovidov
7799dc2f9c
Merge pull request #12336 from ClickHouse/fix-obvious-race-condition-in-test
Fix obvious race condition in test
2020-07-10 01:53:01 +03:00
Anton Popov
c4767557f2
Merge pull request #12306 from CurtizJ/fix-with-fill
Fix order of columns in WITH FILL modifier
2020-07-10 00:12:11 +03:00
Vitaliy Zakaznikov
a012ae3a70 * Updating exitcodes in server_config.py.
* Addintion positive check when user password in LDAP changes.
2020-07-09 22:01:53 +02:00
alesapin
bb46ae8246 Fix tests 2020-07-09 22:14:19 +03:00
alesapin
0d5c747b86 Return strange line from clickhouse-test 2020-07-09 21:59:32 +03:00
Alexander Kuzmenkov
7af916e44a fuzzer docker image 2020-07-09 21:30:22 +03:00
Alexander Tokmakov
77289146ab fix tests 2020-07-09 20:47:42 +03:00
Alexander Kuzmenkov
bbcdf12e4f fuzzer container fix 2020-07-09 20:19:36 +03:00
Alexander Kuzmenkov
0001a08081 More perfect forwarding in field visitors 2020-07-09 19:16:33 +03:00
Anton Popov
8095a4e2bb
Update skip_list.json 2020-07-09 18:46:07 +03:00
alesapin
51aaa8800d Don't skip libs 2020-07-09 18:34:19 +03:00
Ivan Blinkov
258d2fd499
[docs] split various kinds of CREATE queries into separate articles (#12328)
* normalize

* split & adjust links

* re-normalize

* adjust ru links

* adjust ja/tr links

* partially apply e0d19d2aea

* reset contribs
2020-07-09 18:10:35 +03:00
Alexey Milovidov
21449bd28c Fix obvious race condition in test 2020-07-09 17:48:46 +03:00
Alexey Milovidov
1b3d389135 Revert unrelated changes 2020-07-09 17:45:53 +03:00
Alexey Milovidov
635b8f8f9a Fix tests 2020-07-09 17:44:33 +03:00
alexey-milovidov
bb5247ea9d
Merge pull request #12313 from ClickHouse/sanitizer-trap-log-from-separate-thread
Log sanitizer trap messages from separate thread
2020-07-09 17:40:55 +03:00
alexey-milovidov
778dfe5c4a
Merge pull request #12319 from azat/build-fixes
Build fixes
2020-07-09 17:36:16 +03:00
alesapin
0156f43ed3 Human readable errors in alter rename queries 2020-07-09 17:30:38 +03:00
BohuTANG
260bcb9d79 Add integration test for mysql replacement query 2020-07-09 22:20:54 +08:00
alesapin
26293e4640 Rename test 01378 2020-07-09 17:18:50 +03:00
alesapin
9dea4ab323 Initial version 2020-07-09 17:14:44 +03:00
Vladimir Chebotarev
faf6be6576
Implemented single part uploads for DiskS3 (#12026)
* Implemented single part uploads for DiskS3.
* Added `min_multi_part_upload_size` to disk configuration.
2020-07-09 17:09:17 +03:00
Alexander Tokmakov
445acd0294 Merge branch 'master' into database_atomic_improvements 2020-07-09 16:02:54 +03:00
Ivan Blinkov
e0d19d2aea
[docs] engine family introduction refactoring (#12268)
* base refactoring

* adjust links

* Update index.md
2020-07-09 15:11:15 +03:00