mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-23 08:02:02 +00:00
Merge pull request #55392 from azat/dist-insert-threads-fix
Fix missing thread accounting for insert_distributed_sync=1
This commit is contained in:
commit
8609cd25fc
@ -553,8 +553,15 @@ void DistributedSink::onFinish()
|
||||
{
|
||||
if (job.executor)
|
||||
{
|
||||
pool->scheduleOrThrowOnError([&job]()
|
||||
pool->scheduleOrThrowOnError([&job, thread_group = CurrentThread::getGroup()]()
|
||||
{
|
||||
SCOPE_EXIT_SAFE(
|
||||
if (thread_group)
|
||||
CurrentThread::detachFromGroupIfNotDetached();
|
||||
);
|
||||
if (thread_group)
|
||||
CurrentThread::attachToGroupIfDetached(thread_group);
|
||||
|
||||
job.executor->finish();
|
||||
});
|
||||
}
|
||||
|
17
tests/queries/0_stateless/02895_peak_memory_usage_http_headers_regression.sh
Executable file
17
tests/queries/0_stateless/02895_peak_memory_usage_http_headers_regression.sh
Executable file
@ -0,0 +1,17 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
CUR_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
||||
# shellcheck source=../shell_config.sh
|
||||
. "$CUR_DIR"/../shell_config.sh
|
||||
|
||||
$CLICKHOUSE_CLIENT -nm -q "
|
||||
DROP TABLE IF EXISTS data;
|
||||
DROP TABLE IF EXISTS data2;
|
||||
DROP VIEW IF EXISTS mv1;
|
||||
|
||||
CREATE TABLE data (key Int32) ENGINE = Null;
|
||||
CREATE TABLE data2 (key Int32) ENGINE = Null;
|
||||
CREATE MATERIALIZED VIEW mv1 TO data2 AS SELECT * FROM data;
|
||||
"
|
||||
|
||||
${CLICKHOUSE_CURL} -sS "${CLICKHOUSE_URL}" -d @- <<< "INSERT INTO FUNCTION remote('127.{1,2}', $CLICKHOUSE_DATABASE, data, rand()) SELECT * FROM numbers(1e5)"
|
Loading…
Reference in New Issue
Block a user