Commit Graph

145829 Commits

Author SHA1 Message Date
Arthur Passos
cc13783acd Merge branch 'master' into multi_auth_methods 2024-07-02 09:11:20 -03:00
Nikita Mikhaylov
0d7ea528d2
Merge pull request #65971 from ClickHouse/minor-changes-changelog
Minor changes in CHANGELOG
2024-07-02 11:33:00 +00:00
Konstantin Bogdanov
138eb924fa
Merge pull request #65626 from tonickkozlov/tonickkozlov/x509-san-validation
Add support for x509 SubjectAltName identification
2024-07-02 11:20:01 +00:00
Nikita Mikhaylov
36f38e6ae3
Merge pull request #65921 from ClickHouse/no-random-json
No random settings for a test with `Object(JSON)`
2024-07-02 10:57:28 +00:00
vdimir
530ce95d62
Merge pull request #65816 from canhld94/fix_rocksdb_ttl
Fix EmbeddedRocksDB with TTL writes corrupted data
2024-07-02 10:27:36 +00:00
Alexey Milovidov
4613b23c37
Merge pull request #65634 from ClickHouse/fix-object-storage
Speed up loading of plain_rewritable disks; fix many bugs in ObjectStorage
2024-07-02 09:31:29 +00:00
vdimir
59bf6f16bd
Merge pull request #64818 from bigo-sg/too_large_hash_join
Refactor `HashJoin` to avoid `too large translation units`
2024-07-02 09:12:02 +00:00
vdimir
b94dd515c7
Merge pull request #65887 from bigo-sg/improve_concat
Allow to use `concat` function with empty arguments
2024-07-02 09:11:30 +00:00
Alexey Milovidov
ef6d579e7f Minor changes in CHANGELOG 2024-07-02 10:56:03 +02:00
Alexey Milovidov
350711ec53 Merge branch 'master' into fix-object-storage 2024-07-02 08:17:59 +02:00
Alexey Milovidov
9d8cc51dc5
Merge pull request #65917 from azat/mysql-server-TLS-retries
Fix possible issues with MySQL server protocol TLS connections
2024-07-02 05:06:55 +00:00
Alexey Milovidov
3b1e1d01d4
Merge pull request #65848 from ClickHouse/Add_missing_workload_identity_changes
Add missing workload identity changes
2024-07-02 04:35:31 +00:00
Alexey Milovidov
0bb374b597 Fix error (tnx, @jkartseva) 2024-07-02 06:19:21 +02:00
Alexey Milovidov
e07cd70a1e Merge branch 'master' into fix-object-storage 2024-07-02 06:17:55 +02:00
Alexey Milovidov
99ffa2c1b3
Merge pull request #65909 from ClickHouse/auto/v24.6.1.4423-stable
Update version_date.tsv and changelogs after v24.6.1.4423-stable
2024-07-02 03:47:43 +00:00
Michael Kolupaev
30fce5b8d7
Merge pull request #65953 from ClickHouse/og
Use -Og instead of -O0 for debug builds
2024-07-02 03:39:04 +00:00
Alexey Milovidov
b4025b4768
Merge branch 'master' into auto/v24.6.1.4423-stable 2024-07-02 05:27:54 +02:00
Alexey Milovidov
3d67e6b127
Merge pull request #65928 from ClickHouse/follow-up-to-65046
Follow up to #65046
2024-07-02 03:27:08 +00:00
Alexey Milovidov
f627e89637
Merge pull request #65950 from nathanclevenger/patch-1
Fixed documentation typos
2024-07-02 03:17:00 +00:00
taiyang-li
13c3bab624 update doc 2024-07-02 09:54:37 +08:00
Alexey Milovidov
8a8b6a881b
Merge pull request #58970 from ClickHouse/dont-optimize-trivial-insert-select
Disable `optimize_trivial_insert_select` by default
2024-07-02 01:33:23 +00:00
Michael Kolupaev
a5ada16719 Use -Og instead of -O0 for debug builds 2024-07-02 01:11:44 +00:00
Alexey Milovidov
78185fb4a1
Merge pull request #65938 from azat/mysql-client-TLS-retries
Fix possible issues with MySQL client protocol TLS connections
2024-07-01 20:36:14 +00:00
Nathan Clevenger
7a5bf2fc24
Fixed types
Replaced RabbitMQ with NATS
2024-07-01 15:14:37 -05:00
Smita Kulkarni
ac648a1fe3 Fix build 2024-07-01 19:41:45 +02:00
Alexey Milovidov
1e549751c7
Merge pull request #65937 from ClickHouse/auto/v24.5.4.49-stable
Update version_date.tsv and changelogs after v24.5.4.49-stable
2024-07-01 16:56:03 +00:00
Azat Khuzhin
9c7db6711b Fix possible issues with MySQL client protocol TLS connections
Occasionally, 02479_mysql_connect_to_self fails on CI [1].

  [1]: https://github.com/ClickHouse/ClickHouse/issues/50911

The problem was indeed query profiler and EINTR, but not in a way you
may think.

For such failures you may see the following trace in trace_log:

    contrib/openssl/crypto/bio/bss_sock.c:127::sock_read
    contrib/openssl/crypto/bio/bio_meth.c:121::bread_conv
    contrib/openssl/crypto/bio/bio_lib.c:285::bio_read_intern
    contrib/openssl/crypto/bio/bio_lib.c:311::BIO_read
    contrib/openssl/ssl/record/methods/tls_common.c:398::tls_default_read_n
    contrib/openssl/ssl/record/methods/tls_common.c:575::tls_get_more_records
    contrib/openssl/ssl/record/methods/tls_common.c:1122::tls_read_record
    contrib/openssl/ssl/record/rec_layer_s3.c:645::ssl3_read_bytes
    contrib/openssl/ssl/s3_lib.c:4527::ssl3_read_internal
    contrib/openssl/ssl/s3_lib.c:4551::ssl3_read
    contrib/openssl/ssl/ssl_lib.c:2343::ssl_read_internal
    contrib/openssl/ssl/ssl_lib.c:2357::SSL_read
    contrib/mariadb-connector-c/libmariadb/secure/openssl.c:729::ma_tls_read
    contrib/mariadb-connector-c/libmariadb/ma_tls.c:90::ma_pvio_tls_read
    contrib/mariadb-connector-c/libmariadb/ma_pvio.c:250::ma_pvio_read
    contrib/mariadb-connector-c/libmariadb/ma_pvio.c:297::ma_pvio_cache_read
    contrib/mariadb-connector-c/libmariadb/ma_net.c:373::ma_real_read
    contrib/mariadb-connector-c/libmariadb/ma_net.c:427::ma_net_read
    contrib/mariadb-connector-c/libmariadb/mariadb_lib.c:192::ma_net_safe_read
    contrib/mariadb-connector-c/libmariadb/mariadb_lib.c:2138::mthd_my_read_query_result
    contrib/mariadb-connector-c/libmariadb/mariadb_lib.c:2212::mysql_real_query
    src/Common/mysqlxx/Query.cpp:56::mysqlxx::Query::executeImpl()
    src/Common/mysqlxx/Query.cpp:73::mysqlxx::Query::use()
    src/Processors/Sources/MySQLSource.cpp:50::DB::MySQLSource::Connection::Connection()

After which the connection will fail with:

    Code: 1000. DB::Exception: Received from localhost:9000. DB::Exception: mysqlxx::ConnectionLost: Lost connection to MySQL server during query (127.0.0.1:9004). (POCO_EXCEPTION)

But, if you will take a look at ma_tls_read() you will see that it has
proper retries for SSL_ERROR_WANT_READ (and EINTR is just a special case
of it), but still, for some reason it fails.

And the reason is the units of the read/write timeout, ma_tls_read()
calls poll(read_timeout) in case of SSL_ERROR_WANT_READ, but, it
incorrectly assume that the timeout is in milliseconds, but that timeout
was in seconds, this bug had been fixed in [2], and now it works like a
charm!

  [2]: https://github.com/ClickHouse/mariadb-connector-c/pull/17

I've verified it with patching openssl library:

    diff --git a/crypto/bio/bss_sock.c b/crypto/bio/bss_sock.c
    index 82f7be85ae..3d2f3926a0 100644
    --- a/crypto/bio/bss_sock.c
    +++ b/crypto/bio/bss_sock.c
    @@ -124,7 +124,24 @@ static int sock_read(BIO *b, char *out, int outl)
                 ret = ktls_read_record(b->num, out, outl);
             else
     # endif
    -            ret = readsocket(b->num, out, outl);
    +        {
    +            static int i = 0;
    +            static int j = 0;
    +            if (!(++j % 5))
    +            {
    +                fprintf(stderr, "sock_read: inject EAGAIN with ret=0\n");
    +                ret = 0;
    +                errno = EAGAIN;
    +            }
    +            else if (!(++i % 3))
    +            {
    +                fprintf(stderr, "sock_read: inject EAGAIN with ret=-1\n");
    +                ret = -1;
    +                errno = EAGAIN;
    +            }
    +            else
    +                ret = readsocket(b->num, out, outl);
    +        }
             BIO_clear_retry_flags(b);
             if (ret <= 0) {
                 if (BIO_sock_should_retry(ret))

And before this patch (well, not the patch itself, but the referenced
patch in mariadb-connector-c) if you will pass read_write_timeout=1 it
will fail:

    SELECT * FROM mysql('127.0.0.1:9004', system, one, 'default', '', SETTINGS connect_timeout = 100, connection_wait_timeout = 100, read_write_timeout=1)
    Code: 1000. DB::Exception: Received from localhost:9000. DB::Exception: mysqlxx::ConnectionLost: Lost connection to MySQL server during query (127.0.0.1:9004). (POCO_EXCEPTION)

But after, it always works:

    $ ch benchmark -c10 -q "SELECT * FROM mysql('127.0.0.1:9004', system, one, 'default', '', SETTINGS connection_pool_size=1, connect_timeout = 100, connection_wait_timeout = 100, read_write_timeout=1)"
    ^CStopping launch of queries. SIGINT received.

    Queries executed: 478.

    localhost:9000, queries: 478, QPS: 120.171, RPS: 120.171, MiB/s: 0.001, result RPS: 120.171, result MiB/s: 0.001.

    0.000%          0.014 sec.
    10.000%         0.058 sec.
    20.000%         0.065 sec.
    30.000%         0.073 sec.
    40.000%         0.079 sec.
    50.000%         0.087 sec.
    60.000%         0.089 sec.
    70.000%         0.091 sec.
    80.000%         0.095 sec.
    90.000%         0.100 sec.
    95.000%         0.102 sec.
    99.000%         0.105 sec.
    99.900%         0.140 sec.
    99.990%         0.140 sec.

Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2024-07-01 18:39:43 +02:00
robot-clickhouse
46ed186250 Update version_date.tsv and changelogs after v24.5.4.49-stable 2024-07-01 15:05:48 +00:00
kssenii
5541461b99 Fix time of writing to _log table 2024-07-01 16:04:43 +02:00
Nikita Mikhaylov
00b030be3e Better 2024-07-01 13:41:03 +00:00
Nikita Mikhaylov
63b031479c
Merge pull request #65908 from ClickHouse/alexey-milovidov-patch-8
Update CHANGELOG.md
2024-07-01 13:27:59 +00:00
Azat Khuzhin
4f2a0e8eeb Fix possible issues with MySQL server protocol TLS connections
The problem here is that retries (in SecureSocketImpl.cpp::mustRetry())
relies on non-zero socket timeout, but MySQL handler does not set
timeouts for the socket (like other does), and this leads to a problem
when OpenSSL returns SSL_ERROR_WANT_READ/SSL_ERROR_WANT_WRITE, the
connection will be simply terminated.

I've played with this patch, by hacking the openssl sources:

    diff --git a/crypto/bio/bss_sock.c b/crypto/bio/bss_sock.c
    index 82f7be85ae..a399291ff4 100644
    --- a/crypto/bio/bss_sock.c
    +++ b/crypto/bio/bss_sock.c
    @@ -124,7 +125,18 @@ static int sock_read(BIO *b, char *out, int outl)
                 ret = ktls_read_record(b->num, out, outl);
             else
     # endif
    -            ret = readsocket(b->num, out, outl);
    +        {
    +            /* pthread_kill(pthread_self(), SIGUSR1); */
    +            static int i = 0;
    +            if (!(++i % 2))
    +            {
    +                fprintf(stderr, "sock_read: inject EAGAIN\n");
    +                ret = -1;
    +                errno = EAGAIN;
    +            }
    +            else
    +                ret = readsocket(b->num, out, outl);
    +        }
             BIO_clear_retry_flags(b);
             if (ret <= 0) {
                 if (BIO_sock_should_retry(ret))

And after this patch this succeed without errors:

    ch benchmark -c10 -q "SELECT * FROM mysql('127.0.0.1:9004', system, one, 'default', '', SETTINGS connection_pool_size=1, connect_timeout = 100, connection_wait_timeout = 100)"

Note, that this also fixes the timeouts for plain (non-TLS) connections

Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2024-07-01 15:22:33 +02:00
Nikolai Kochetov
5a6e6d3c5d
Merge pull request #65771 from kitaisreal/postgresql-source-support-cancel-query
PostgreSQL source support cancel query
2024-07-01 10:17:01 +00:00
Anton Kozlov
b1b9aaf2ec Add support for x509 SubjectAltName identification 2024-07-01 09:47:28 +00:00
vdimir
632ad5156d
Merge branch 'master' into fix_rocksdb_ttl 2024-07-01 11:01:08 +02:00
robot-clickhouse
0ad049d2e5 Update version_date.tsv and changelogs after v24.6.1.4423-stable 2024-07-01 08:55:11 +00:00
Alexey Milovidov
5b50726e2b
Update CHANGELOG.md 2024-07-01 10:34:32 +02:00
taiyang-li
bb8fc59d7c update doc 2024-07-01 15:36:08 +08:00
taiyang-li
4fcafde610 allow empty arguments for concat 2024-07-01 15:29:32 +08:00
Antonio Andelic
50c1121c6a
Merge pull request #65735 from ClickHouse/fix-keeper-session-close-bug
Fix bug with session closing in Keeper
2024-07-01 07:12:33 +00:00
Antonio Andelic
43bd12f86b
Merge pull request #65819 from ClickHouse/keeper-respect-cgroup-cpu
Respect cgroup CPU limit in Keeper
2024-07-01 06:57:43 +00:00
Duc Canh Le
047dcfb806 fix undefined LOGICAL_ERROR
Signed-off-by: Duc Canh Le <duccanh.le@ahrefs.com>
2024-07-01 04:39:53 +00:00
Alexey Milovidov
7f0f0d6257
Merge pull request #65855 from kevisong/patch-1
Update mergetree.md bullet points structure
2024-07-01 04:37:35 +00:00
Alexey Milovidov
bf4c856739
Merge pull request #65874 from ClickHouse/changelog-24.6
Add changelog for release 24.6
2024-07-01 03:05:58 +00:00
Alexey Milovidov
770e637f9b Add changelog for release 24.6 2024-07-01 03:51:45 +02:00
Alexey Milovidov
1eac2abf8f Fix test 2024-06-30 20:58:00 +02:00
Alexey Milovidov
97311bd51f Merge branch 'master' of github.com:ClickHouse/ClickHouse into dont-optimize-trivial-insert-select 2024-06-30 20:56:54 +02:00
Alexey Milovidov
20f39c64ec
Merge pull request #65866 from ClickHouse/alexey-milovidov-patch-8
Update CHANGELOG.md
2024-06-30 18:55:46 +00:00
Igor Nikonov
2fcca61fe9
Merge pull request #65769 from ClickHouse/fix-progress-bar-read-in-order
Fix: progress bar for read in order queries
2024-06-30 18:07:13 +00:00
Alexey Milovidov
5a1125418b
Update CHANGELOG.md 2024-06-30 19:24:03 +02:00