Skip to content

Commit a59100b

Browse files
committed
Merge remote-tracking branch 'ClickHouse/master' into add_bech32_enc_dec
2 parents d7b48dc + 1cffe42 commit a59100b

File tree

332 files changed

+2392
-735
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

332 files changed

+2392
-735
lines changed

.gitmodules

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -296,9 +296,6 @@
296296
[submodule "contrib/aws-c-compression"]
297297
path = contrib/aws-c-compression
298298
url = https://github.com/awslabs/aws-c-compression
299-
[submodule "contrib/aws-s2n-tls"]
300-
path = contrib/aws-s2n-tls
301-
url = https://github.com/ClickHouse/s2n-tls
302299
[submodule "contrib/crc32-vpmsum"]
303300
path = contrib/crc32-vpmsum
304301
url = https://github.com/antonblanchard/crc32-vpmsum.git

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
* Gives the possibility to truncate specific tables from a database, filtered with the `LIKE` keyword. [#78597](https://github.com/ClickHouse/ClickHouse/pull/78597) ([Yarik Briukhovetskyi](https://github.com/yariks5s)).
4242
* Support `_part_starting_offset` virtual column in `MergeTree`-family tables. This column represents the cumulative row count of all preceding parts, calculated at query time based on the current part list. The cumulative values are retained throughout query execution and remain effective even after part pruning. Related internal logic has been refactored to support this behavior. [#79417](https://github.com/ClickHouse/ClickHouse/pull/79417) ([Amos Bird](https://github.com/amosbird)).
4343
* Add functions `divideOrNull`,`moduloOrNull`, `intDivOrNull`,`positiveModuloOrNull` to return NULL when right argument is zero. [#78276](https://github.com/ClickHouse/ClickHouse/pull/78276) ([kevinyhzou](https://github.com/KevinyhZou)).
44-
* TODO: WTF is that? Explain it in a way your gradma will understand. Support for Iceberg partition pruning bucket transform. [#79262](https://github.com/ClickHouse/ClickHouse/pull/79262) ([Daniil Ivanik](https://github.com/divanik)).
44+
* Add [`icebergHash`](https://iceberg.apache.org/spec/#appendix-b-32-bit-hash-requirements) and [`icebergBucketTransform`](https://iceberg.apache.org/spec/#bucket-transform-details) functions. Support data files pruning in `Iceberg` tables partitioned with [`bucket transfom`](https://iceberg.apache.org/spec/#partitioning). [#79262](https://github.com/ClickHouse/ClickHouse/pull/79262) ([Daniil Ivanik](https://github.com/divanik)).
4545

4646
#### Experimental Feature
4747
* Hive metastore catalog for Iceberg datalake. [#77677](https://github.com/ClickHouse/ClickHouse/pull/77677) ([scanhex12](https://github.com/scanhex12)).

base/poco/NetSSL_OpenSSL/include/Poco/Net/SecureSocketImpl.h

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -236,21 +236,16 @@ namespace Net
236236
/// to be able to re-use it again.
237237

238238
private:
239-
using MutexT = Poco::FastMutex;
240-
using LockT = MutexT::ScopedLock;
241-
using UnLockT = Poco::ScopedLockWithUnlock<MutexT>;
242-
243239
SecureSocketImpl(const SecureSocketImpl &);
244240
SecureSocketImpl & operator=(const SecureSocketImpl &);
245241

246242
mutable std::recursive_mutex _mutex;
247-
std::atomic<SSL *> _pSSL;
243+
SSL * _pSSL; // GUARDED_BY _mutex
248244
Poco::AutoPtr<SocketImpl> _pSocket;
249245
Context::Ptr _pContext;
250246
bool _needHandshake;
251247
std::string _peerHostName;
252248
Session::Ptr _pSession;
253-
mutable MutexT _ssl_mutex;
254249

255250
friend class SecureStreamSocketImpl;
256251

base/poco/NetSSL_OpenSSL/src/SecureSocketImpl.cpp

Lines changed: 6 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,6 @@ void SecureSocketImpl::acceptSSL()
103103
std::lock_guard<std::recursive_mutex> lock(_mutex);
104104
poco_assert (!_pSSL);
105105

106-
LockT l(_ssl_mutex);
107-
108106
BIO* pBIO = BIO_new(BIO_s_socket());
109107
if (!pBIO) throw SSLException("Cannot create BIO object");
110108
BIO_set_fd(pBIO, static_cast<int>(_pSocket->sockfd()), BIO_NOCLOSE);
@@ -171,8 +169,6 @@ void SecureSocketImpl::connectSSL(bool performHandshake)
171169
poco_assert (!_pSSL);
172170
poco_assert (_pSocket->initialized());
173171

174-
LockT l(_ssl_mutex);
175-
176172
BIO* pBIO = BIO_new(BIO_s_socket());
177173
if (!pBIO) throw SSLException("Cannot create SSL BIO object");
178174
BIO_set_fd(pBIO, static_cast<int>(_pSocket->sockfd()), BIO_NOCLOSE);
@@ -250,8 +246,6 @@ void SecureSocketImpl::shutdown()
250246
std::lock_guard<std::recursive_mutex> lock(_mutex);
251247
if (_pSSL)
252248
{
253-
UnLockT l(_ssl_mutex);
254-
255249
// Don't shut down the socket more than once.
256250
int shutdownState = SSL_get_shutdown(_pSSL);
257251
bool shutdownSent = (shutdownState & SSL_SENT_SHUTDOWN) == SSL_SENT_SHUTDOWN;
@@ -266,7 +260,6 @@ void SecureSocketImpl::shutdown()
266260
// done with it.
267261
int rc = SSL_shutdown(_pSSL);
268262
if (rc < 0) handleError(rc);
269-
l.unlock();
270263
if (_pSocket->getBlocking())
271264
{
272265
_pSocket->shutdown();
@@ -297,9 +290,6 @@ int SecureSocketImpl::sendBytes(const void* buffer, int length, int flags)
297290
poco_check_ptr (_pSSL);
298291

299292
int rc;
300-
301-
LockT l(_ssl_mutex);
302-
303293
if (_needHandshake)
304294
{
305295
rc = completeHandshake();
@@ -341,8 +331,6 @@ int SecureSocketImpl::receiveBytes(void* buffer, int length, int flags)
341331
poco_assert (_pSocket->initialized());
342332
poco_check_ptr (_pSSL);
343333

344-
LockT l(_ssl_mutex);
345-
346334
/// Special case: just check that we can read from socket
347335
if ((flags & MSG_DONTWAIT) && (flags & MSG_PEEK))
348336
return _pSocket->receiveBytes(buffer, length, flags);
@@ -380,8 +368,6 @@ int SecureSocketImpl::available() const
380368
std::lock_guard<std::recursive_mutex> lock(_mutex);
381369
poco_check_ptr (_pSSL);
382370

383-
LockT l(_ssl_mutex);
384-
385371
return SSL_pending(_pSSL);
386372
}
387373

@@ -478,20 +464,10 @@ bool SecureSocketImpl::isLocalHost(const std::string& hostName)
478464
X509* SecureSocketImpl::peerCertificate() const
479465
{
480466
std::lock_guard<std::recursive_mutex> lock(_mutex);
481-
LockT l(_ssl_mutex);
482-
483-
X509* pCert = nullptr;
484-
485467
if (_pSSL)
486-
{
487-
pCert = ::SSL_get_peer_certificate(_pSSL);
488-
489-
if (X509_V_OK != SSL_get_verify_result(_pSSL))
490-
throw CertificateValidationException("SecureSocketImpl::peerCertificate(): "
491-
"Certificate verification error " + Utility::getLastError());
492-
}
493-
494-
return pCert;
468+
return SSL_get1_peer_certificate(_pSSL);
469+
else
470+
return 0;
495471
}
496472

497473
Poco::Timespan SecureSocketImpl::getMaxTimeoutOrLimit()
@@ -632,8 +608,6 @@ void SecureSocketImpl::reset()
632608
close();
633609
if (_pSSL)
634610
{
635-
LockT l(_ssl_mutex);
636-
637611
SSL_free(_pSSL);
638612
_pSSL = nullptr;
639613
}
@@ -678,12 +652,9 @@ bool SecureSocketImpl::sessionWasReused()
678652
{
679653
std::lock_guard<std::recursive_mutex> lock(_mutex);
680654
if (_pSSL)
681-
{
682-
LockT l(_ssl_mutex);
683-
return ::SSL_session_reused(_pSSL) != 0;
684-
}
685-
686-
return false;
655+
return SSL_session_reused(_pSSL) != 0;
656+
else
657+
return false;
687658
}
688659

689660
void SecureSocketImpl::setBlocking(bool flag)

contrib/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,6 @@ add_contrib (aws-cmake
122122
aws-c-mqtt
123123
aws-c-s3
124124
aws-c-sdkutils
125-
aws-s2n-tls
126125
aws-checksums
127126
aws-crt-cpp
128127
aws-cmake

contrib/aws-cmake/CMakeLists.txt

Lines changed: 5 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ include("${ClickHouse_SOURCE_DIR}/contrib/aws-cmake/AwsThreadName.cmake")
2727
include("${ClickHouse_SOURCE_DIR}/contrib/aws-cmake/AwsSIMD.cmake")
2828
include("${ClickHouse_SOURCE_DIR}/contrib/aws-crt-cpp/cmake/AwsGetVersion.cmake")
2929

30+
set (AWS_STUBS "${ClickHouse_SOURCE_DIR}/contrib/aws-cmake/aws_stubs.cpp")
31+
3032

3133
# Gather sources and options.
3234
set(AWS_SOURCES)
@@ -47,11 +49,6 @@ if (ENABLE_OPENSSL_ENCRYPTION)
4749
list(APPEND AWS_PRIVATE_COMPILE_DEFS "-DENABLE_OPENSSL_ENCRYPTION")
4850
endif()
4951

50-
set(USE_S2N ON)
51-
if (USE_S2N)
52-
list(APPEND AWS_PRIVATE_COMPILE_DEFS "-DUSE_S2N")
53-
endif()
54-
5552

5653
# Directories.
5754
SET(AWS_SDK_DIR "${ClickHouse_SOURCE_DIR}/contrib/aws")
@@ -70,7 +67,6 @@ SET(AWS_EVENT_STREAM_DIR "${ClickHouse_SOURCE_DIR}/contrib/aws-c-event-stream")
7067
SET(AWS_HTTP_DIR "${ClickHouse_SOURCE_DIR}/contrib/aws-c-http")
7168
SET(AWS_IO_DIR "${ClickHouse_SOURCE_DIR}/contrib/aws-c-io")
7269
SET(AWS_MQTT_DIR "${ClickHouse_SOURCE_DIR}/contrib/aws-c-mqtt")
73-
SET(AWS_S2N_TLS_DIR "${ClickHouse_SOURCE_DIR}/contrib/aws-s2n-tls")
7470
SET(AWS_S3_DIR "${ClickHouse_SOURCE_DIR}/contrib/aws-c-s3")
7571
SET(AWS_SDKUTILS_DIR "${ClickHouse_SOURCE_DIR}/contrib/aws-c-sdkutils")
7672

@@ -287,39 +283,10 @@ elseif (OS_DARWIN)
287283
)
288284
endif()
289285

290-
set(AWS_IO_TLS_SRC)
291-
if (USE_S2N)
292-
file(GLOB AWS_IO_TLS_SRC
293-
"${AWS_IO_DIR}/source/s2n/*.c"
294-
)
295-
endif()
296-
297-
list(APPEND AWS_SOURCES ${AWS_IO_SRC} ${AWS_IO_OS_SRC} ${AWS_IO_TLS_SRC})
286+
list(APPEND AWS_SOURCES ${AWS_IO_SRC} ${AWS_IO_OS_SRC})
298287
list(APPEND AWS_PUBLIC_INCLUDES "${AWS_IO_DIR}/include/")
299288

300289

301-
# aws-s2n-tls
302-
if (USE_S2N)
303-
file(GLOB AWS_S2N_TLS_SRC
304-
"${AWS_S2N_TLS_DIR}/crypto/*.c"
305-
"${AWS_S2N_TLS_DIR}/error/*.c"
306-
"${AWS_S2N_TLS_DIR}/stuffer/*.c"
307-
"${AWS_S2N_TLS_DIR}/pq-crypto/*.c"
308-
"${AWS_S2N_TLS_DIR}/pq-crypto/kyber_r3/*.c"
309-
"${AWS_S2N_TLS_DIR}/tls/*.c"
310-
"${AWS_S2N_TLS_DIR}/tls/extensions/*.c"
311-
"${AWS_S2N_TLS_DIR}/utils/*.c"
312-
)
313-
314-
list(APPEND AWS_SOURCES ${AWS_S2N_TLS_SRC})
315-
316-
list(APPEND AWS_PRIVATE_INCLUDES
317-
"${AWS_S2N_TLS_DIR}/"
318-
"${AWS_S2N_TLS_DIR}/api/"
319-
)
320-
endif()
321-
322-
323290
# aws-crt-cpp
324291
file(GLOB AWS_CRT_SRC
325292
"${AWS_CRT_DIR}/source/*.cpp"
@@ -336,11 +303,6 @@ list(APPEND AWS_PUBLIC_INCLUDES "${AWS_CRT_DIR}/include/")
336303

337304

338305
# aws-c-mqtt
339-
file(GLOB AWS_MQTT_SRC
340-
"${AWS_MQTT_DIR}/source/*.c"
341-
)
342-
343-
list(APPEND AWS_SOURCES ${AWS_MQTT_SRC})
344306
list(APPEND AWS_PUBLIC_INCLUDES "${AWS_MQTT_DIR}/include/")
345307

346308

@@ -388,6 +350,8 @@ file(GLOB AWS_SDK_GLUE_SRC
388350
list(APPEND AWS_SOURCES ${AWS_SDK_GLUE_SRC})
389351
list(APPEND AWS_PUBLIC_INCLUDES "${AWS_SDK_GLUE_DIR}/include/")
390352

353+
list(APPEND AWS_SOURCES ${AWS_STUBS})
354+
391355
# Add library.
392356
add_library(_aws ${AWS_SOURCES})
393357

contrib/aws-cmake/aws_stubs.cpp

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
extern "C" {
2+
3+
/// Symbols for aws-c-mqtt and aws-s2n-tls
4+
/// which are not used anywhere except those stubs.
5+
6+
// TLS context creation (returns null)
7+
__attribute__((weak)) void *aws_tls_client_ctx_new() { return nullptr; }
8+
__attribute__((weak)) void *aws_tls_server_ctx_new() { return nullptr; }
9+
10+
// TLS static init/cleanup (do nothing)
11+
__attribute__((weak)) void aws_tls_init_static_state() {}
12+
__attribute__((weak)) void aws_tls_clean_up_static_state() {}
13+
14+
// MQTT init/cleanup (do nothing)
15+
__attribute__((weak)) void aws_mqtt_library_init() {}
16+
__attribute__((weak)) void aws_mqtt_library_clean_up() {}
17+
18+
// Darwin-specific TLS handlers (return null or 0)
19+
__attribute__((weak)) void *aws_tls_client_handler_new() { return nullptr; }
20+
__attribute__((weak)) void *aws_tls_server_handler_new() { return nullptr; }
21+
__attribute__((weak)) int aws_tls_client_handler_start_negotiation() { return 0; }
22+
__attribute__((weak)) void *aws_tls_handler_protocol() { return nullptr; }
23+
__attribute__((weak)) int aws_tls_is_alpn_available() { return 0; }
24+
25+
} // extern "C"

contrib/aws-s2n-tls

Lines changed: 0 additions & 1 deletion
This file was deleted.

docker/keeper/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ RUN arch=${TARGETARCH:-amd64} \
3838
# lts / testing / prestable / etc
3939
ARG REPO_CHANNEL="stable"
4040
ARG REPOSITORY="https://packages.clickhouse.com/tgz/${REPO_CHANNEL}"
41-
ARG VERSION="25.4.4.25"
41+
ARG VERSION="25.4.5.24"
4242
ARG PACKAGES="clickhouse-keeper"
4343
ARG DIRECT_DOWNLOAD_URLS=""
4444

docker/server/Dockerfile.alpine

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ RUN arch=${TARGETARCH:-amd64} \
3535
# lts / testing / prestable / etc
3636
ARG REPO_CHANNEL="stable"
3737
ARG REPOSITORY="https://packages.clickhouse.com/tgz/${REPO_CHANNEL}"
38-
ARG VERSION="25.4.4.25"
38+
ARG VERSION="25.4.5.24"
3939
ARG PACKAGES="clickhouse-client clickhouse-server clickhouse-common-static"
4040
ARG DIRECT_DOWNLOAD_URLS=""
4141

0 commit comments

Comments
 (0)