Skip to content

Commit

Permalink
[Fix](segment iterator) fix wrong segment cache remove (apache#29333)
Browse files Browse the repository at this point in the history
  • Loading branch information
airborne12 committed Dec 30, 2023
1 parent f207976 commit ab65216
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion be/src/olap/rowset/segment_v2/segment_iterator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1987,7 +1987,8 @@ Status SegmentIterator::_read_columns_by_rowids(std::vector<ColumnId>& read_colu

Status SegmentIterator::next_batch(vectorized::Block* block) {
auto status = [&]() { RETURN_IF_CATCH_EXCEPTION({ return _next_batch_internal(block); }); }();
if (!status.ok()) {
// if rows read by batch is 0, will return end of file, we should not remove segment cache in this situation.
if (!status.ok() && !status.is<END_OF_FILE>()) {
_segment->remove_from_segment_cache();
}
return status;
Expand Down

0 comments on commit ab65216

Please sign in to comment.