You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by yi...@apache.org on 2022/07/25 09:57:59 UTC

[doris] branch master updated: [bugfix] fix coredump caused by wrong type cast of OlapScanNode (#11165)

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

yiguolei 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 00e2944102 [bugfix] fix coredump caused by wrong type cast of OlapScanNode (#11165)
00e2944102 is described below

commit 00e2944102a273559ace7de31dfafce785108556
Author: TengJianPing <18...@users.noreply.github.com>
AuthorDate: Mon Jul 25 17:57:53 2022 +0800

    [bugfix] fix coredump caused by wrong type cast of OlapScanNode (#11165)
---
 be/src/exec/exec_node.cpp         |  2 +-
 be/src/exec/olap_scan_node.h      |  3 ---
 be/src/exec/scan_node.h           |  5 +++++
 be/src/vec/exec/volap_scan_node.h | 18 ------------------
 4 files changed, 6 insertions(+), 22 deletions(-)

diff --git a/be/src/exec/exec_node.cpp b/be/src/exec/exec_node.cpp
index d1ed0fc323..97afb5fa05 100644
--- a/be/src/exec/exec_node.cpp
+++ b/be/src/exec/exec_node.cpp
@@ -669,7 +669,7 @@ void ExecNode::try_do_aggregate_serde_improve() {
         return;
     }
 
-    OlapScanNode* scan_node = static_cast<OlapScanNode*>(agg_node[0]->_children[0]);
+    ScanNode* scan_node = static_cast<ScanNode*>(agg_node[0]->_children[0]);
     scan_node->set_no_agg_finalize();
 }
 
diff --git a/be/src/exec/olap_scan_node.h b/be/src/exec/olap_scan_node.h
index 771adf76e8..5d5b700356 100644
--- a/be/src/exec/olap_scan_node.h
+++ b/be/src/exec/olap_scan_node.h
@@ -55,7 +55,6 @@ public:
     Status collect_query_statistics(QueryStatistics* statistics) override;
     Status close(RuntimeState* state) override;
     Status set_scan_ranges(const std::vector<TScanRangeParams>& scan_ranges) override;
-    void set_no_agg_finalize() { _need_agg_finalize = false; }
     Status get_hints(TabletSharedPtr table, const TPaloScanRange& scan_range, int block_row_count,
                      bool is_begin_include, bool is_end_include,
                      const std::vector<std::unique_ptr<OlapScanRange>>& scan_key_range,
@@ -267,8 +266,6 @@ protected:
     std::unique_ptr<MemTracker> _scanner_mem_tracker;
     EvalConjunctsFn _eval_conjuncts_fn;
 
-    bool _need_agg_finalize = true;
-
     // the max num of scan keys of this scan request.
     // it will set as BE's config `doris_max_scan_key_num`,
     // or be overwritten by value in TQueryOptions
diff --git a/be/src/exec/scan_node.h b/be/src/exec/scan_node.h
index 227d32f25f..22589399de 100644
--- a/be/src/exec/scan_node.h
+++ b/be/src/exec/scan_node.h
@@ -81,6 +81,8 @@ public:
 
     bool is_scan_node() const override { return true; }
 
+    void set_no_agg_finalize() { _need_agg_finalize = false; }
+
     RuntimeProfile::Counter* bytes_read_counter() const { return _bytes_read_counter; }
     RuntimeProfile::Counter* rows_read_counter() const { return _rows_read_counter; }
     RuntimeProfile::Counter* total_throughput_counter() const { return _total_throughput_counter; }
@@ -102,6 +104,9 @@ protected:
     // Wall based aggregate read throughput [bytes/sec]
     RuntimeProfile::Counter* _total_throughput_counter;
     RuntimeProfile::Counter* _num_disks_accessed_counter;
+
+protected:
+    bool _need_agg_finalize = true;
 };
 
 } // namespace doris
diff --git a/be/src/vec/exec/volap_scan_node.h b/be/src/vec/exec/volap_scan_node.h
index 0caa9d029d..4ead17f9b3 100644
--- a/be/src/vec/exec/volap_scan_node.h
+++ b/be/src/vec/exec/volap_scan_node.h
@@ -53,8 +53,6 @@ public:
 
     Status set_scan_ranges(const std::vector<TScanRangeParams>& scan_ranges) override;
 
-    void set_no_agg_finalize() { _need_agg_finalize = false; }
-
     Status get_hints(TabletSharedPtr table, const TPaloScanRange& scan_range, int block_row_count,
                      bool is_begin_include, bool is_end_include,
                      const std::vector<std::unique_ptr<OlapScanRange>>& scan_key_range,
@@ -167,26 +165,12 @@ private:
     // Keeps track of total splits and the number finished.
     ProgressUpdater _progress;
 
-    // Lock and condition variables protecting _materialized_row_batches.  Row batches are
-    // produced asynchronously by the scanner threads and consumed by the main thread in
-    // GetNext.  Row batches must be processed by the main thread in the order they are
-    // queued to avoid freeing attached resources prematurely (row batches will never depend
-    // on resources attached to earlier batches in the queue).
-    // This lock cannot be taken together with any other locks except _lock.
-    std::mutex _row_batches_lock;
-    std::condition_variable _row_batch_added_cv;
-    std::condition_variable _row_batch_consumed_cv;
-
-    std::list<RowBatch*> _materialized_row_batches;
     // to limit _materialized_row_batches_bytes < _max_scanner_queue_size_bytes / 2
     std::atomic_size_t _materialized_row_batches_bytes = 0;
 
-    std::mutex _scan_batches_lock;
-    std::condition_variable _scan_batch_added_cv;
     std::atomic_int _running_thread = 0;
     std::condition_variable _scan_thread_exit_cv;
 
-    std::list<RowBatch*> _scan_row_batches;
     // to limit _scan_row_batches_bytes < _max_scanner_queue_size_bytes / 2
     std::atomic_size_t _scan_row_batches_bytes = 0;
 
@@ -222,8 +206,6 @@ private:
     std::unique_ptr<MemTracker> _scanner_mem_tracker;
     EvalConjunctsFn _eval_conjuncts_fn;
 
-    bool _need_agg_finalize = true;
-
     // the max num of scan keys of this scan request.
     // it will set as BE's config `doris_max_scan_key_num`,
     // or be overwritten by value in TQueryOptions


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