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

yiguolei pushed a commit to branch dev-1.1.2
in repository https://gitbox.apache.org/repos/asf/doris.git

commit 90dadafd167a6913dcbd6df3f30c7f97c5137f26
Author: Yongqiang YANG <98214048+dataroar...@users.noreply.github.com>
AuthorDate: Fri Aug 12 11:28:43 2022 +0800

    [fix](profile) close eof scanner before transfer done (#11705)
    
    We should close eof scanners before transfer done, otherwise,
    they are closed until scannode is closed. Because plan is closed
    after the plan is finished, so query profile would leak stats from
    scanners closed by scannode::close. e.g. SegmentTotalNum in profile
    is less.
---
 be/src/vec/exec/volap_scan_node.cpp | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/be/src/vec/exec/volap_scan_node.cpp 
b/be/src/vec/exec/volap_scan_node.cpp
index 343d670fd9..4ea1c3f1f3 100644
--- a/be/src/vec/exec/volap_scan_node.cpp
+++ b/be/src/vec/exec/volap_scan_node.cpp
@@ -118,6 +118,16 @@ void VOlapScanNode::transfer_thread(RuntimeState* state) {
                 }
             } else {
                 if (_scanner_done) {
+                    // We should close eof scanners before transfer done, 
otherwise,
+                    // they are closed until scannode is closed. Because plan 
is closed
+                    // after the plan is finished, so query profile would leak 
stats from
+                    // scanners closed by scannode::close.
+                    while (!_volap_scanners.empty()) {
+                        auto scanner = _volap_scanners.front();
+                        _volap_scanners.pop_front();
+                        DCHECK(scanner->need_to_close());
+                        scanner->close(state);
+                    }
                     break;
                 }
             }


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to