From d9ee367b278223625fb65c79642cf88727b8519c Mon Sep 17 00:00:00 2001 From: chenhao16 Date: Thu, 17 Aug 2017 21:35:30 +0800 Subject: [PATCH 1/2] be crashes by mini load when no hll_hash specified for hll column --- be/src/exec/csv_scan_node.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/be/src/exec/csv_scan_node.cpp b/be/src/exec/csv_scan_node.cpp index d11cbf442072ce..52f1a1980b416c 100644 --- a/be/src/exec/csv_scan_node.cpp +++ b/be/src/exec/csv_scan_node.cpp @@ -350,7 +350,7 @@ Status CsvScanNode::close(RuntimeState* state) { SCOPED_TIMER(_runtime_profile->total_time_counter()); - if (memory_used_counter() != nullptr) { + if (memory_used_counter() != nullptr && _tuple_pool.get() != nullptr) { COUNTER_UPDATE(memory_used_counter(), _tuple_pool->peak_allocated_bytes()); } From adac2b4b3cb40baee316ad9b435d757bd647c4e3 Mon Sep 17 00:00:00 2001 From: zhaochun Date: Thu, 17 Aug 2017 21:17:45 +0800 Subject: [PATCH 2/2] Fix 3002, bug fix assert fail if broker scan failed Change-Id: Ifb9eb057f104b99679efc04b930ea8263e1f4055 --- be/src/runtime/data_spliter.cpp | 6 +++++- be/src/runtime/row_batch.cpp | 11 ++++++++++- be/src/runtime/row_batch.h | 4 ++++ 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/be/src/runtime/data_spliter.cpp b/be/src/runtime/data_spliter.cpp index ae889e6b4bffa3..20f4137446baab 100644 --- a/be/src/runtime/data_spliter.cpp +++ b/be/src/runtime/data_spliter.cpp @@ -288,9 +288,13 @@ Status DataSpliter::close(RuntimeState* state, Status close_status) { is_ok = false; err_status = status; } - iter.second->reset(); + iter.second->clear(); } } + } else { + for (const auto& iter : _batch_map) { + iter.second->clear(); + } } // finish sink for (const auto& iter : _dpp_sink_vec) { diff --git a/be/src/runtime/row_batch.cpp b/be/src/runtime/row_batch.cpp index 616581e50cfcb7..c2f9c9e9f25e8a 100644 --- a/be/src/runtime/row_batch.cpp +++ b/be/src/runtime/row_batch.cpp @@ -166,7 +166,11 @@ RowBatch::RowBatch(const RowDescriptor& row_desc, const TRowBatch& input_batch, } } -RowBatch::~RowBatch() { +void RowBatch::clear() { + if (_cleared) { + return; + } + _tuple_data_pool->free_all(); for (int i = 0; i < _io_buffers.size(); ++i) { _io_buffers[i]->return_buffer(); @@ -181,6 +185,11 @@ RowBatch::~RowBatch() { _mem_tracker->release(_tuple_ptrs_size); _tuple_ptrs = NULL; } + _cleared = true; +} + +RowBatch::~RowBatch() { + clear(); } int RowBatch::serialize(TRowBatch* output_batch) { diff --git a/be/src/runtime/row_batch.h b/be/src/runtime/row_batch.h index fdf650604e45d2..3ed9cea8a5474a 100644 --- a/be/src/runtime/row_batch.h +++ b/be/src/runtime/row_batch.h @@ -99,6 +99,9 @@ class RowBatch : public RowBatchInterface { // - buffer handles from the io mgr virtual ~RowBatch(); + // used to c + void clear(); + static const int INVALID_ROW_INDEX = -1; // Add n rows of tuple pointers after the last committed row and return its index. @@ -486,6 +489,7 @@ class RowBatch : public RowBatchInterface { std::string _compression_scratch; int _scanner_id; + bool _cleared = false; }; /// Macros for iterating through '_row_batch', starting at '_start_row_idx'.