This is an automated email from the ASF dual-hosted git repository.

airborne pushed a commit to branch branch-2.1
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/branch-2.1 by this push:
     new 68b7783e3af [Fix](scanner) lazy update block mem usage when status is 
not ok #40953 (#41034)
68b7783e3af is described below

commit 68b7783e3afa8bcf6c03df5a47055373cf18b22a
Author: airborne12 <[email protected]>
AuthorDate: Fri Sep 20 15:09:26 2024 +0800

    [Fix](scanner) lazy update block mem usage when status is not ok #40953 
(#41034)
    
    cherry pick from #40953
---
 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 ac50a71c862..01d50b4ff3c 100644
--- a/be/src/vec/exec/scan/scanner_scheduler.cpp
+++ b/be/src/vec/exec/scan/scanner_scheduler.cpp
@@ -277,14 +277,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()->rows() + free_block->rows() <= 
ctx->batch_size()) {


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to