Skip to content

Commit 9c036a0

Browse files
[enhancement](memory) add exception handle logic in memtable flush (apache#39913)
## Proposed changes Issue Number: close #xxx <!--Describe your changes.--> --------- Co-authored-by: yiguolei <yiguolei@gmail.com>
1 parent cacef8d commit 9c036a0

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

be/src/olap/memtable.cpp

+6-1
Original file line numberDiff line numberDiff line change
@@ -505,7 +505,7 @@ bool MemTable::need_agg() const {
505505
return false;
506506
}
507507

508-
Status MemTable::to_block(std::unique_ptr<vectorized::Block>* res) {
508+
Status MemTable::_to_block(std::unique_ptr<vectorized::Block>* res) {
509509
size_t same_keys_num = _sort();
510510
if (_keys_type == KeysType::DUP_KEYS || same_keys_num == 0) {
511511
if (_keys_type == KeysType::DUP_KEYS && _tablet_schema->num_key_columns() == 0) {
@@ -529,4 +529,9 @@ Status MemTable::to_block(std::unique_ptr<vectorized::Block>* res) {
529529
return Status::OK();
530530
}
531531

532+
Status MemTable::to_block(std::unique_ptr<vectorized::Block>* res) {
533+
RETURN_IF_ERROR_OR_CATCH_EXCEPTION(_to_block(res));
534+
return Status::OK();
535+
}
536+
532537
} // namespace doris

be/src/olap/memtable.h

+3
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,9 @@ class MemTable {
205205
void _aggregate_two_row_in_block(vectorized::MutableBlock& mutable_block, RowInBlock* new_row,
206206
RowInBlock* row_in_skiplist);
207207

208+
// Used to wrapped by to_block to do exception handle logic
209+
Status _to_block(std::unique_ptr<vectorized::Block>* res);
210+
208211
private:
209212
int64_t _tablet_id;
210213
bool _enable_unique_key_mow = false;

0 commit comments

Comments
 (0)