Merge pull request #125706 from groeneai/fix-executing-graph-build-error-pipeline-dump

Attach the pipeline dump only to a logical error from building the executing graph
This commit is contained in:
Alexey Milovidov authored and GitHub committed 2026-10-17 19:56:56 +00:00
commit b4901fe6ac
5 files changed
+30 -6

No files matched your search

+1
View File
@@ -37,6 +37,7 @@ static struct InitFiu
ONCE(nats_fail_resubscribe_within_query) \
REGULAR(replicated_queue_unfail_entries) \
REGULAR(executing_graph_add_node_fail) \
REGULAR(executing_graph_build_fail) \
PAUSEABLE_ONCE(polling_queue_before_try_poll) \
ONCE(replicated_merge_tree_insert_quorum_fail_0) \
REGULAR(replicated_merge_tree_commit_zk_fail_when_recovering_from_hw_fault) \
@@ -34,6 +34,7 @@ namespace ErrorCodes
namespace FailPoints
{
extern const char executing_graph_add_node_fail[];
extern const char executing_graph_build_fail[];
}
namespace Runtime::V1
@@ -45,6 +46,12 @@ ExecutingGraph::ExecutingGraph(
, profile_processors(profile_processors_)
, spill_state(nodes, memory_reservation_)
{
/// Stands in for an allocation failure while the graph is built.
fiu_do_on(FailPoints::executing_graph_build_fail,
{
throw Exception(ErrorCodes::MEMORY_LIMIT_EXCEEDED, "Failpoint {} is triggered", FailPoints::executing_graph_build_fail);
});
/// Create nodes for every processor and register their spillable components.
for (auto it = processors->begin(); it != processors->end(); ++it)
addNode(it);
@@ -169,12 +169,14 @@ PipelineExecutor::PipelineExecutor(std::shared_ptr<Processors> processors, Query
}
catch (Exception & exception)
{
/// If exception was thrown while pipeline initialization, it means that query pipeline was not build correctly.
/// It is logical error, and we need more information about pipeline.
WriteBufferFromOwnString buf;
printPipeline(*processors, buf);
buf.finalize();
exception.addMessage("Query pipeline:\n" + buf.str());
/// A logical error here means the pipeline was built incorrectly: append a dump of it.
if (exception.code() == ErrorCodes::LOGICAL_ERROR)
{
WriteBufferFromOwnString buf;
printPipeline(*processors, buf);
buf.finalize();
exception.addMessage("Query pipeline:\n" + buf.str());
}
throw;
}
@@ -0,0 +1,12 @@
#!/usr/bin/env bash
# Tags: no-fasttest
# no-fasttest: needs a failpoint.
CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
# shellcheck source=../shell_config.sh
. "$CURDIR"/../shell_config.sh
# A memory limit hit while the executing graph is built is not a malformed pipeline: the error must not carry a dump of it.
output=$(${CLICKHOUSE_LOCAL} --query "SYSTEM ENABLE FAILPOINT executing_graph_build_fail; SELECT number FROM numbers(10) FORMAT Null" 2>&1)
echo "$output" | grep -c 'Failpoint executing_graph_build_fail is triggered' || true
echo "$output" | grep -c 'Query pipeline' || true