This is an automated email from the ASF dual-hosted git repository.
yiguolei pushed a commit to branch branch-2.1
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/branch-2.1 by this push:
new d7659ff34d6 [fix](bytebuffer) fix allocate size improper in
append_and_flush (#40613) (#41133)
d7659ff34d6 is described below
commit d7659ff34d6049d0bc6bbe2e0ecd5a40e38d59e8
Author: hui lai <[email protected]>
AuthorDate: Tue Sep 24 16:01:52 2024 +0800
[fix](bytebuffer) fix allocate size improper in append_and_flush (#40613)
(#41133)
pick (#40613)
fix allocate size improper in append_and_flush introduced by
https://github.com/apache/doris/pull/38960
---
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 392125e6fc0..45c81971b18 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<uint8_t[]>* 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);
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]