oleg-zinovev commented on a change in pull request #1838: DRILL-7341: Vector reAlloc may fails after exchange URL: https://github.com/apache/drill/pull/1838#discussion_r311989195
########## File path: exec/vector/src/main/codegen/templates/FixedValueVectors.java ########## @@ -210,10 +210,16 @@ public void reAlloc() { // a zero-length buffer. Instead, just allocate a 256 byte // buffer if we start at 0. - final long newAllocationSize = allocationSizeInBytes == 0 + long newAllocationSize = allocationSizeInBytes == 0 ? 256 : allocationSizeInBytes * 2L; + // Some operations, such as Value Vector#exchange, can be change DrillBuf data field without corresponding allocation size changes. + // Check that the size of the allocation is sufficient to copy the old buffer. + while (newAllocationSize < data.capacity()) { Review comment: Done. Could you clarify why DrillBuf#setZero performed only for FixedValueVectors? ---------------------------------------------------------------- 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