From 84d68885d52e3874a2c11f01ab9d037d408451a9 Mon Sep 17 00:00:00 2001 From: laihui <1353307710@qq.com> Date: Tue, 10 Sep 2024 16:38:10 +0800 Subject: [PATCH] fix allocate size improper in append_and_flush --- be/src/io/fs/stream_load_pipe.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/be/src/io/fs/stream_load_pipe.cpp b/be/src/io/fs/stream_load_pipe.cpp index 0dc27e009d08ee..4b204a2aace833 100644 --- a/be/src/io/fs/stream_load_pipe.cpp +++ b/be/src/io/fs/stream_load_pipe.cpp @@ -113,7 +113,7 @@ Status StreamLoadPipe::read_one_message(std::unique_ptr* data, size_t Status StreamLoadPipe::append_and_flush(const char* data, size_t size, size_t proto_byte_size) { SCOPED_ATTACH_TASK(ExecEnv::GetInstance()->stream_load_pipe_tracker()); ByteBufferPtr buf; - RETURN_IF_ERROR(ByteBuffer::allocate(128 * 1024, &buf)); + RETURN_IF_ERROR(ByteBuffer::allocate(BitUtil::RoundUpToPowerOfTwo(size + 1), &buf)); buf->put_bytes(data, size); buf->flip(); return _append(buf, proto_byte_size);