Skip to content

Commit

Permalink
[bugfix](load) fix be crash in write ordinal_index when flush mem_table
Browse files Browse the repository at this point in the history
commit apache#9123 makes bitshuffle_page return error when remain capacity
is not enough, which lead to column_write return error and cannot
finish_current_page even when page is full, then be crash when flush
memtable, found that some column is empty, and crashed in build oridinal
index page.
  • Loading branch information
yixiutt committed May 11, 2022
1 parent 99b8e08 commit df1efeb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions be/src/olap/rowset/segment_v2/bitshuffle_page.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,11 @@ class BitshufflePageBuilder : public PageBuilder {
template <bool single>
inline Status add_internal(const uint8_t* vals, size_t* count) {
DCHECK(!_finished);
if (_remain_element_capacity <= 0) {
int to_add = std::min<int>(_remain_element_capacity, *count);
if (to_add == 0) {
*count = 0;
return Status::RuntimeError("page is full.");
return Status::OK();
}
int to_add = std::min<int>(_remain_element_capacity, *count);
int to_add_size = to_add * SIZE_OF_TYPE;
size_t orig_size = _data.size();
_data.resize(orig_size + to_add_size);
Expand Down

0 comments on commit df1efeb

Please sign in to comment.