mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-27 10:02:01 +00:00
Fix final progress for INSERT SELECT over TCP
Move sending of progress and profile events after calling BlockIO::onFinish() since it will call on_finish callback, that will do the final flush of progress (at least WriteProgress). Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
This commit is contained in:
parent
7c1a3996e8
commit
3efd941233
@ -369,10 +369,12 @@ void TCPHandler::runImpl()
|
||||
{
|
||||
state.need_receive_data_for_insert = true;
|
||||
processInsertQuery();
|
||||
state.io.onFinish();
|
||||
}
|
||||
else if (state.io.pipeline.pulling())
|
||||
{
|
||||
processOrdinaryQueryWithProcessors();
|
||||
state.io.onFinish();
|
||||
}
|
||||
else if (state.io.pipeline.completed())
|
||||
{
|
||||
@ -398,7 +400,8 @@ void TCPHandler::runImpl()
|
||||
}
|
||||
executor.execute();
|
||||
|
||||
/// Send final progress
|
||||
state.io.onFinish();
|
||||
/// Send final progress after calling onFinish(), since it will update the progress.
|
||||
///
|
||||
/// NOTE: we cannot send Progress for regular INSERT (with VALUES)
|
||||
/// without breaking protocol compatibility, but it can be done
|
||||
@ -406,8 +409,10 @@ void TCPHandler::runImpl()
|
||||
sendProgress();
|
||||
sendSelectProfileEvents();
|
||||
}
|
||||
|
||||
state.io.onFinish();
|
||||
else
|
||||
{
|
||||
state.io.onFinish();
|
||||
}
|
||||
|
||||
/// Do it before sending end of stream, to have a chance to show log message in client.
|
||||
query_scope->logPeakMemoryUsage();
|
||||
|
Loading…
Reference in New Issue
Block a user