This is an automated email from the ASF dual-hosted git repository.
airborne pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/master by this push:
new 2495d129f2d [Fix](scanner) lazy update block mem usage when status is
not ok (#40953)
2495d129f2d is described below
commit 2495d129f2d9b8d239c832d5bc9c29e2efede269
Author: airborne12 <[email protected]>
AuthorDate: Thu Sep 19 14:16:48 2024 +0800
[Fix](scanner) lazy update block mem usage when status is not ok (#40953)
## Proposed changes
fix problem like this:
```
set enable_common_expr_pushdown=false;
create table t(a int, c varchar(1024)) PROPERTIES ("replication_allocation"
= "tag.location.default: 1");
insert into t values(1, "a b c d e");
SELECT count() FROM t where c MATCH_PHRASE_EDGE 's';
I20240919 09:31:40.713896 2224044 internal_service.cpp:626] Cancel query
3e48a306704f4691-840d239bf31420aa, reason: [INTERNAL_ERROR]PStatus:
(127.0.0.1)[INTERNAL_ERROR]Column match_phrase_edge({"c", "String"}) in block
is nullptr, in method bytes. All Columns are c String match_phrase_edge({"c",
"String"})
3# doris::vectorized::Block::allocated_bytes() const at
be/src/vec/core/block.cpp:446
4#
doris::vectorized::ScannerScheduler::_scanner_scan(std::shared_ptr<doris::vectorized::ScannerContext>,
std::shared_ptr<doris::vectorized::ScanTask>) at
be/src/vec/exec/scan/scanner_scheduler.cpp:243
```
---
be/src/vec/exec/scan/scanner_scheduler.cpp | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/be/src/vec/exec/scan/scanner_scheduler.cpp
b/be/src/vec/exec/scan/scanner_scheduler.cpp
index 444ff4dbb0c..fdd677f0687 100644
--- a/be/src/vec/exec/scan/scanner_scheduler.cpp
+++ b/be/src/vec/exec/scan/scanner_scheduler.cpp
@@ -278,14 +278,14 @@ void
ScannerScheduler::_scanner_scan(std::shared_ptr<ScannerContext> ctx,
ctx->update_peak_memory_usage(free_block->allocated_bytes());
ctx->update_peak_memory_usage(-free_block->allocated_bytes());
status = scanner->get_block_after_projects(state,
free_block.get(), &eos);
- // Projection will truncate useless columns, makes block size
change.
- auto free_block_bytes = free_block->allocated_bytes();
- ctx->update_peak_memory_usage(free_block_bytes);
first_read = false;
if (!status.ok()) {
LOG(WARNING) << "Scan thread read VScanner failed: " <<
status.to_string();
break;
}
+ // Projection will truncate useless columns, makes block size
change.
+ auto free_block_bytes = free_block->allocated_bytes();
+ ctx->update_peak_memory_usage(free_block_bytes);
raw_bytes_read += free_block_bytes;
if (!scan_task->cached_blocks.empty() &&
scan_task->cached_blocks.back().first->rows() +
free_block->rows() <=
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]