Skip to content

Commit 68d07d0

Browse files
authored
Merge branch 'master' into parallel-distributed-insert-select-by-default
2 parents 1c87604 + 46a9656 commit 68d07d0

File tree

105 files changed

+682
-1036
lines changed

Some content is hidden

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

105 files changed

+682
-1036
lines changed

.clang-tidy

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ Checks: [
2828
'-bugprone-unchecked-optional-access',
2929
'-bugprone-crtp-constructor-accessibility',
3030
'-bugprone-not-null-terminated-result',
31-
'-bugprone-forward-declaration-namespace',
3231

3332
'-cert-dcl16-c',
3433
'-cert-err58-cpp',

README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,9 @@ curl https://clickhouse.com/ | sh
3434

3535
## Monthly Release & Community Call
3636

37-
Every month we get together with the community (users, contributors, customers, those interested in learning more about ClickHouse) to discuss what is coming in the latest release.
38-
If you are interested in sharing what you've built on ClickHouse, let us know.
37+
ClickHouse **Release 25.6** is published!
3938

40-
* [v25.6 Community & Release Call](https://clickhouse.com/company/events/v25-6-community-release-call) - June 26
39+
This release includes the new data type, a new type of MergeTree, tokenization for logs, functions for time series, the new monitoring UI, and many more. [Presentation](https://presentations.clickhouse.com/2025-release-25.6/), [Video](https://www.youtube.com/watch?v=_9IBOM3pR4U), [Changelog](https://github.com/ClickHouse/ClickHouse/blob/master/CHANGELOG.md).
4140

4241
## Upcoming Events
4342

ci/jobs/build_clickhouse.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
temp_dir = f"{current_directory}/ci/tmp"
1414

1515
BUILD_TYPE_TO_CMAKE = {
16-
BuildTypes.AMD_DEBUG: f" cmake --debug-trycompile -DCMAKE_VERBOSE_MAKEFILE=1 -LA -DCMAKE_BUILD_TYPE=Debug -DENABLE_THINLTO=0 -DSANITIZE= -DENABLE_CHECK_HEAVY_BUILDS=1 -DENABLE_CLICKHOUSE_SELF_EXTRACTING=1 -DCMAKE_C_COMPILER={ToolSet.COMPILER_C} -DCMAKE_CXX_COMPILER={ToolSet.COMPILER_CPP} -DCOMPILER_CACHE=sccache -DENABLE_BUILD_PROFILING=1 -DENABLE_TESTS=1 -DENABLE_LEXER_TEST=1 -DENABLE_UTILS=0 -DCMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY=ON -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_INSTALL_SYSCONFDIR=/etc -DCMAKE_INSTALL_LOCALSTATEDIR=/var -DCMAKE_SKIP_INSTALL_ALL_DEPENDENCY=ON -DENABLE_XRAY=1",
16+
BuildTypes.AMD_DEBUG: f" cmake --debug-trycompile -DCMAKE_VERBOSE_MAKEFILE=1 -LA -DCMAKE_BUILD_TYPE=Debug -DENABLE_THINLTO=0 -DSANITIZE= -DENABLE_CHECK_HEAVY_BUILDS=1 -DENABLE_CLICKHOUSE_SELF_EXTRACTING=1 -DCMAKE_C_COMPILER={ToolSet.COMPILER_C} -DCMAKE_CXX_COMPILER={ToolSet.COMPILER_CPP} -DCOMPILER_CACHE=sccache -DENABLE_BUILD_PROFILING=1 -DENABLE_TESTS=1 -DENABLE_LEXER_TEST=1 -DENABLE_UTILS=0 -DCMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY=ON -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_INSTALL_SYSCONFDIR=/etc -DCMAKE_INSTALL_LOCALSTATEDIR=/var -DCMAKE_SKIP_INSTALL_ALL_DEPENDENCY=ON -DENABLE_XRAY=1 -DENABLE_EXAMPLES=1",
1717
BuildTypes.AMD_RELEASE: f" cmake --debug-trycompile -DCMAKE_VERBOSE_MAKEFILE=1 -LA -DCMAKE_BUILD_TYPE=None -DENABLE_THINLTO=1 -DSANITIZE= -DENABLE_CHECK_HEAVY_BUILDS=1 -DENABLE_CLICKHOUSE_SELF_EXTRACTING=1 -DCMAKE_C_COMPILER={ToolSet.COMPILER_C} -DCMAKE_CXX_COMPILER={ToolSet.COMPILER_CPP} -DCOMPILER_CACHE=sccache -DENABLE_BUILD_PROFILING=1 -DENABLE_TESTS=0 -DENABLE_LEXER_TEST=0 -DENABLE_UTILS=0 -DCMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY=ON -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_INSTALL_SYSCONFDIR=/etc -DCMAKE_INSTALL_LOCALSTATEDIR=/var -DCMAKE_SKIP_INSTALL_ALL_DEPENDENCY=ON -DSPLIT_DEBUG_SYMBOLS=ON -DBUILD_STANDALONE_KEEPER=1",
1818
BuildTypes.AMD_BINARY: f" cmake --debug-trycompile -DCMAKE_VERBOSE_MAKEFILE=1 -LA -DCMAKE_BUILD_TYPE=None -DENABLE_THINLTO=0 -DSANITIZE= -DENABLE_CHECK_HEAVY_BUILDS=1 -DENABLE_CLICKHOUSE_SELF_EXTRACTING=1 -DCMAKE_C_COMPILER={ToolSet.COMPILER_C} -DCMAKE_CXX_COMPILER={ToolSet.COMPILER_CPP} -DCOMPILER_CACHE=sccache -DENABLE_BUILD_PROFILING=1 -DENABLE_TESTS=0 -DENABLE_LEXER_TEST=0 -DENABLE_UTILS=0 -DCMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY=ON",
1919
BuildTypes.AMD_ASAN: f" cmake --debug-trycompile -DCMAKE_VERBOSE_MAKEFILE=1 -LA -DCMAKE_BUILD_TYPE=None -DENABLE_THINLTO=0 -DSANITIZE=address -DENABLE_CHECK_HEAVY_BUILDS=1 -DENABLE_CLICKHOUSE_SELF_EXTRACTING=1 -DCMAKE_C_COMPILER={ToolSet.COMPILER_C} -DCMAKE_CXX_COMPILER={ToolSet.COMPILER_CPP} -DCOMPILER_CACHE=sccache -DENABLE_BUILD_PROFILING=1 -DENABLE_TESTS=1 -DENABLE_LEXER_TEST=1 -DENABLE_UTILS=0 -DCMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY=ON -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_INSTALL_SYSCONFDIR=/etc -DCMAKE_INSTALL_LOCALSTATEDIR=/var -DCMAKE_SKIP_INSTALL_ALL_DEPENDENCY=ON",

ci/jobs/scripts/check_style/aspell-ignore/en/aspell-dict.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
personal_ws-1.1 en 3283
1+
personal_ws-1.1 en 3283
22
AArch
33
ACLs
44
ALTERs
@@ -802,6 +802,8 @@ PagerDuty
802802
ParallelFormattingOutputFormatThreads
803803
ParallelFormattingOutputFormatThreadsActive
804804
ParallelParsingInputFormat
805+
ParallelParsingInputFormatThreads
806+
ParallelParsingInputFormatThreadsActive
805807
ParallelReplicasMode
806808
ParquetCompression
807809
ParquetMetadata

contrib/rust_vendor

Submodule rust_vendor updated 2826 files

docs/en/operations/system-tables/metrics.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -524,6 +524,14 @@ Number of threads in the ParallelFormattingOutputFormatThreads thread pool.
524524

525525
Number of threads in the ParallelFormattingOutputFormatThreads thread pool running a task.
526526

527+
### ParallelParsingInputFormatThreads {#parallelparsinginputformatthreads}
528+
529+
Number of threads in the ParallelParsingInputFormat thread pool.
530+
531+
### ParallelParsingInputFormatThreadsActive {#parallelparsinginputformatthreadsactive}
532+
533+
Number of threads in the ParallelParsingInputFormat thread pool running a task.
534+
527535
### PartMutation {#partmutation}
528536

529537
Number of mutations (ALTER DELETE/UPDATE)

programs/client/Client.cpp

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -325,29 +325,26 @@ void Client::initialize(Poco::Util::Application & self)
325325
config().setString("password", env_password);
326326

327327
/// settings and limits could be specified in config file, but passed settings has higher priority
328-
for (const auto & setting : global_context->getSettingsRef().getUnchangedNames())
328+
for (const auto & setting : client_context->getSettingsRef().getUnchangedNames())
329329
{
330330
String name{setting};
331331
if (config().has(name))
332-
global_context->setSetting(name, config().getString(name));
332+
client_context->setSetting(name, config().getString(name));
333333
}
334334

335335
/// Set path for format schema files
336336
if (config().has("format_schema_path"))
337-
global_context->setFormatSchemaPath(fs::weakly_canonical(config().getString("format_schema_path")));
337+
client_context->setFormatSchemaPath(fs::weakly_canonical(config().getString("format_schema_path")));
338338

339339
/// Set the path for google proto files
340340
if (config().has("google_protos_path"))
341-
global_context->setGoogleProtosPath(fs::weakly_canonical(config().getString("google_protos_path")));
341+
client_context->setGoogleProtosPath(fs::weakly_canonical(config().getString("google_protos_path")));
342342
}
343343

344344

345345
int Client::main(const std::vector<std::string> & /*args*/)
346346
try
347347
{
348-
/// For memory tracking
349-
MainThreadStatus::getInstance();
350-
351348
setupSignalHandler();
352349

353350
output_stream << std::fixed << std::setprecision(3);
@@ -358,7 +355,8 @@ try
358355
registerAggregateFunctions();
359356

360357
processConfig();
361-
adjustSettings();
358+
adjustSettings(client_context);
359+
362360
initTTYBuffer(
363361
toProgressOption(config().getString("progress", "default")), toProgressOption(config().getString("progress-table", "default")));
364362
initKeystrokeInterceptor();
@@ -886,10 +884,10 @@ void Client::processOptions(
886884
if (options.count("opentelemetry-tracestate"))
887885
global_context->getClientTraceContext().tracestate = options["opentelemetry-tracestate"].as<std::string>();
888886

889-
/// In case of clickhouse-client the `client_context` can be just an alias for the `global_context`.
890-
/// (There is no need to copy the context because clickhouse-client has no background tasks so it won't use that context in parallel.)
891-
client_context = global_context;
892-
initClientContext();
887+
initClientContext(Context::createCopy(global_context));
888+
/// Initialize query context for the current thread to avoid sharing global context (i.e. for obtaining session_timezone)
889+
query_scope.emplace(client_context);
890+
893891

894892
/// Allow to pass-through unknown settings to the server.
895893
client_context->getAccessControl().allowAllSettings();
@@ -921,7 +919,7 @@ void Client::processConfig()
921919

922920
query_id = config().getString("query_id", "");
923921
if (!query_id.empty())
924-
global_context->setCurrentQueryId(query_id);
922+
client_context->setCurrentQueryId(query_id);
925923
}
926924

927925
if (is_interactive || delayed_interactive)
@@ -1131,6 +1129,8 @@ void Client::readArguments(
11311129

11321130
int mainEntryClickHouseClient(int argc, char ** argv)
11331131
{
1132+
DB::MainThreadStatus::getInstance();
1133+
11341134
try
11351135
{
11361136
DB::Client client;

programs/client/Client.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,5 +69,7 @@ class Client : public ClientApplicationBase
6969
#endif
7070
void parseConnectionsCredentials(Poco::Util::AbstractConfiguration & config, const std::string & connection_name);
7171
std::vector<String> loadWarningMessages();
72+
73+
std::optional<CurrentThread::QueryScope> query_scope;
7274
};
7375
}

programs/keeper-bench/Runner.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -576,7 +576,8 @@ struct ZooKeeperRequestFromLogReader
576576
context,
577577
context->getSettingsRef()[DB::Setting::max_block_size],
578578
format_settings,
579-
DB::FormatParserGroup::singleThreaded(context->getSettingsRef()),
579+
1,
580+
std::nullopt,
580581
/*is_remote_fs*/ false,
581582
DB::CompressionMethod::None,
582583
false);

programs/local/LocalServer.cpp

Lines changed: 5 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -129,9 +129,6 @@ namespace ServerSetting
129129
extern const ServerSettingsUInt64 max_prefixes_deserialization_thread_pool_size;
130130
extern const ServerSettingsUInt64 max_prefixes_deserialization_thread_pool_free_size;
131131
extern const ServerSettingsUInt64 prefixes_deserialization_thread_pool_thread_pool_queue_size;
132-
extern const ServerSettingsUInt64 max_format_parsing_thread_pool_size;
133-
extern const ServerSettingsUInt64 max_format_parsing_thread_pool_free_size;
134-
extern const ServerSettingsUInt64 format_parsing_thread_pool_queue_size;
135132
}
136133

137134
namespace ErrorCodes
@@ -269,11 +266,6 @@ void LocalServer::initialize(Poco::Util::Application & self)
269266
server_settings[ServerSetting::max_prefixes_deserialization_thread_pool_size],
270267
server_settings[ServerSetting::max_prefixes_deserialization_thread_pool_free_size],
271268
server_settings[ServerSetting::prefixes_deserialization_thread_pool_thread_pool_queue_size]);
272-
273-
getFormatParsingThreadPool().initialize(
274-
server_settings[ServerSetting::max_format_parsing_thread_pool_size],
275-
server_settings[ServerSetting::max_format_parsing_thread_pool_free_size],
276-
server_settings[ServerSetting::format_parsing_thread_pool_queue_size]);
277269
}
278270

279271

@@ -575,8 +567,6 @@ void LocalServer::connect()
575567
int LocalServer::main(const std::vector<std::string> & /*args*/)
576568
try
577569
{
578-
thread_status.emplace();
579-
580570
StackTrace::setShowAddresses(server_settings[ServerSetting::show_addresses_in_stack_traces]);
581571

582572
setupSignalHandler();
@@ -643,7 +633,8 @@ try
643633
/// Must be called after we stopped initializing the global context and changing its settings.
644634
/// After this point the global context must be stayed almost unchanged till shutdown,
645635
/// and all necessary changes must be made to the client context instead.
646-
createClientContext();
636+
initClientContext(Context::createCopy(global_context));
637+
/// Note, QueryScope will be initialized in the LocalConnection
647638

648639
if (is_interactive)
649640
{
@@ -902,7 +893,7 @@ void LocalServer::processConfig()
902893
/// NOTE: it is important to apply any overrides before
903894
/// `setDefaultProfiles` calls since it will copy current context (i.e.
904895
/// there is separate context for Buffer tables).
905-
adjustSettings();
896+
adjustSettings(global_context);
906897
applySettingsOverridesForLocal(global_context);
907898
applyCmdOptions(global_context);
908899

@@ -1080,16 +1071,6 @@ void LocalServer::applyCmdOptions(ContextMutablePtr context)
10801071
}
10811072

10821073

1083-
void LocalServer::createClientContext()
1084-
{
1085-
/// In case of clickhouse-local it's necessary to use a separate context for client-related purposes.
1086-
/// We can't just change the global context because it is used in background tasks (for example, in merges)
1087-
/// which don't expect that the global context can suddenly change.
1088-
client_context = Context::createCopy(global_context);
1089-
initClientContext();
1090-
}
1091-
1092-
10931074
void LocalServer::processOptions(const OptionsDescription &, const CommandLineOptions & options, const std::vector<Arguments> &, const std::vector<Arguments> &)
10941075
{
10951076
if (options.count("path"))
@@ -1172,6 +1153,8 @@ void LocalServer::readArguments(int argc, char ** argv, Arguments & common_argum
11721153

11731154
int mainEntryClickHouseLocal(int argc, char ** argv)
11741155
{
1156+
DB::MainThreadStatus::getInstance();
1157+
11751158
try
11761159
{
11771160
DB::LocalServer app;

0 commit comments

Comments
 (0)