wangbo commented on issue #2075: Segment v2 stream load core dump(#2037)
URL: https://github.com/apache/incubator-doris/pull/2075#issuecomment-547277108
 
 
   >We make BitShuffleBuilder finish's return slice is same with what it will 
release. Then there is no need to add finish_and_release.
   1. This way break PageBuilder.finish 's semantics,when caller calls finish 
and release, BitShufflePageBuilder will release faststring twice,this would 
make memory leak;Or caller need to know the BitShufflePageBuilder.finish 
because it's different from other PageBuilder's finish
   2. Other PageBuilder use faststring as buffer too,So they may meet the same 
problem with BitShuffleBuilder,just fix BitShuffleBuilder may be not enough.
   
   >We remove release interface and keep finish and finish_and_release. Because 
if we can't keep release and finish consistent, it will lead to other problems.
   
   I prefer this way;when caller just use page returned by PageBuilder to 
copy,they call finish.
   When caller maintains page,they call release_and_finish
   
   >My suggestion is to combine Slice finish() and Slice release() into 
OwnedSlice finish(). OwnedSlice owns slice's data and is a move-only type. This 
will make ownership transfer clear and remove all potential bugs.
   
   This way means PageBuilder always release its page and use OwnedSlice to 
maintain returned page?
   If so,faststring's optimization is useless,because whether array grow 
happens,it always return a array using new to allocate

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to