Skip to content

Commit

Permalink
check memtable empty in FlushToken::submit()
Browse files Browse the repository at this point in the history
  • Loading branch information
kaijchen committed Jul 6, 2023
1 parent 2c32d66 commit 730e638
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
3 changes: 0 additions & 3 deletions be/src/olap/delta_writer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -263,9 +263,6 @@ Status DeltaWriter::write(const vectorized::Block* block, const std::vector<int>
}

Status DeltaWriter::_flush_memtable_async() {
if (_mem_table->empty()) {
return Status::OK();
}
return _flush_token->submit(std::move(_mem_table));
}

Expand Down
3 changes: 3 additions & 0 deletions be/src/olap/memtable_flush_executor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@ Status FlushToken::submit(std::unique_ptr<MemTable> mem_table) {
if (s != OK) {
return Status::Error(s);
}
if (mem_table->empty()) {
return Status::OK();
}
int64_t submit_task_time = MonotonicNanos();
auto task = std::make_shared<MemtableFlushTask>(
this, std::move(mem_table), _rowset_writer->allocate_segment_id(), submit_task_time);
Expand Down

0 comments on commit 730e638

Please sign in to comment.