incubator-doris Why DCHECK got_buffer?

mrwjdhj3  于 2022-04-22  发布在  Java
关注(0)|答案(0)|浏览(98)

We run be in ASAN mode, and met the DCHECK(got_buffer) core:
incubator-doris/be/src/exec/partitioned_aggregation_node.cc

Lines 747 to 751 in 7bf926e

| | bool got_buffer; |
| | RETURN_IF_ERROR(aggregated_row_stream->PrepareForWrite(&got_buffer)); |
| | DCHECK(got_buffer) << "Buffer included in reservation " << parent->_id << "\n" |
| | << parent->_buffer_pool_client.DebugString() << "\n" |
| | << parent->DebugString(2); |

It hints that got_buffer can't be false.
But in func

incubator-doris/be/src/runtime/buffered_tuple_stream3.cc

Lines 217 to 232 in 9d03ba2

| | Status BufferedTupleStream3::PrepareForWrite(bool* got_reservation) { |
| | // This must be the first iterator created. |
| | DCHECK(pages_.empty()); |
| | DCHECK(!delete_on_read_); |
| | DCHECK(!has_write_iterator()); |
| | DCHECK(!has_read_iterator()); |
| | CHECK_CONSISTENCY_FULL(); |
| | |
| | *got_reservation = buffer_pool_client_->IncreaseReservationToFit(default_page_len_); |
| | if (!*got_reservation) returnStatus::OK(); |
| | has_write_iterator_ = true; |
| | // Save reservation for the write iterators. |
| | buffer_pool_client_->SaveReservation(&write_page_reservation_, default_page_len_); |
| | CHECK_CONSISTENCY_FULL(); |
| | returnStatus::OK(); |
| | } |

Whether or not got_buffer is true, always returns OK.
We need fix this code logic, e.g. if *got_reservation == false, return Status::Error()?

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题