From 9579634eac68e6f65099a1f4f78687f36eff3a23 Mon Sep 17 00:00:00 2001 From: HappenLee Date: Mon, 25 Sep 2023 08:38:31 +0800 Subject: [PATCH] [Debug](pipeline) add log of pipeline scan bug (#24804) --- be/src/pipeline/exec/operator.h | 7 ++++++- be/src/pipeline/pipeline_task.cpp | 7 ++++++- be/src/vec/exec/scan/vscan_node.cpp | 3 +-- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/be/src/pipeline/exec/operator.h b/be/src/pipeline/exec/operator.h index 4ba2aec977fef1..73e2d5d41b8f97 100644 --- a/be/src/pipeline/exec/operator.h +++ b/be/src/pipeline/exec/operator.h @@ -450,7 +450,12 @@ class StatefulOperator : public StreamingOperator { if (node->need_more_input_data()) { _child_block->clear_column_data(); - RETURN_IF_ERROR(child->get_block(state, _child_block.get(), _child_source_state)); + Status status = child->get_block(state, _child_block.get(), _child_source_state); + if (status.is<777>()) { + LOG(INFO) << "Scan block nullptr error _source_state:" << int(source_state) + << " query id:" << print_id(state->query_id()); + } + RETURN_IF_ERROR(status); source_state = _child_source_state; if (_child_block->rows() == 0 && _child_source_state != SourceState::FINISHED) { return Status::OK(); diff --git a/be/src/pipeline/pipeline_task.cpp b/be/src/pipeline/pipeline_task.cpp index 07be52dd243466..c1257d5cd5ee0e 100644 --- a/be/src/pipeline/pipeline_task.cpp +++ b/be/src/pipeline/pipeline_task.cpp @@ -274,7 +274,12 @@ Status PipelineTask::execute(bool* eos) { { SCOPED_TIMER(_get_block_timer); _get_block_counter->update(1); - RETURN_IF_ERROR(_root->get_block(_state, block, _data_state)); + auto status = _root->get_block(_state, block, _data_state); + if (status.is<777>()) { + LOG(FATAL) << "Scan block nullptr error: can read:" << source_can_read() + << " query id:" << print_id(_state->query_id()); + } + RETURN_IF_ERROR(status); } *eos = _data_state == SourceState::FINISHED; diff --git a/be/src/vec/exec/scan/vscan_node.cpp b/be/src/vec/exec/scan/vscan_node.cpp index 67d2c16d1f78b7..a610376757888f 100644 --- a/be/src/vec/exec/scan/vscan_node.cpp +++ b/be/src/vec/exec/scan/vscan_node.cpp @@ -265,8 +265,7 @@ Status VScanNode::get_next(RuntimeState* state, vectorized::Block* block, bool* } if (scan_block == nullptr) { - LOG(FATAL) << "Scan block nullptr error _context_queue_id:" << _context_queue_id - << " context debug string:" << _scanner_ctx->debug_string(); + return Status::Error<777>("not pointer in scan pipline"); } // get scanner's block memory block->swap(*scan_block);