github-actions[bot] commented on code in PR #68426:
URL: https://github.com/apache/doris/pull/68426#discussion_r4082668698


##########
be/src/exprs/aggregate/aggregate_function_map_v2.h:
##########
@@ -129,7 +129,7 @@ struct AggregateFunctionMapAggDataV2 {
         int64_t written_bytes = buf_ptr - serialized_buffer.data();
         DCHECK_LE(written_bytes, serialized_bytes);
 
-        serialized_buffer.resize(serialized_bytes);
+        serialized_buffer.resize(written_bytes);

Review Comment:
   [P1] Preserve StreamVByte's readable suffix when changing this frame. 
`read()` copies the exact-sized blob into a fresh `std::string`, but the pinned 
SIMD decoder may read `STREAMVBYTE_PADDING` (16) bytes beyond the compressed 
payload; Doris's block serializer and datatype tests explicitly append that 
padding ([upstream 
contract](https://github.com/fast-pack/streamvbyte/blob/master/README.md#usage)).
 The 65-IPv4 frame is 189 bytes and its final SIMD load reaches byte 200; the 
17-IPv6 frame is 144 bytes and its load reaches byte 152, so valid union/merge 
states can read out of bounds. Please give both key and value decode buffers 
private 16-byte scratch tails while comparing consumption with their saved 
logical ends. Also handle rolling versions: a new writer can send this exact 
frame to an old reader with the same unpadded path, so new-reader scratch alone 
is insufficient; gate the exact framing on a negotiated BE version or otherwise 
keep old peers on a safe padded format. This i
 s distinct from the prior thread because logical frame length and 
decoder-accessible padding are separate contracts.



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to