gaodayue commented on a change in pull request #2075: Segment v2 stream load
core dump(#2037)
URL: https://github.com/apache/incubator-doris/pull/2075#discussion_r341434595
##########
File path: be/src/olap/rowset/segment_v2/rle_page.h
##########
@@ -122,11 +113,14 @@ class RlePageBuilder : public PageBuilder {
// this api will release the memory ownership of encoded data
// Note:
- // release() should be called after finish
// reset() should be called after this function before reuse the
builder
- void release() override {
- uint8_t* ret = _buf.release();
- (void)ret;
+ OwnedSlice release() override {
+ _finished = true;
+ // here should Flush first and then encode the count header
+ // or it will lead to a bug if the header is less than 8 byte and the
data is small
+ _rle_encoder->Flush();
+ encode_fixed32_le(&_buf[0], _count);
+ return OwnedSlice(Slice(_buf.release(), _buf.size()));
Review comment:
`_buf.size()` is 0 after `_buf.release()`. You should save `_buf.size()`
first.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]