Skip to content

[client] Fix corruption after zero-copy lazy parse ByteBuf#3008

Open
fresh-borzoni wants to merge 1 commit intoapache:mainfrom
fresh-borzoni:fix-indexed-zero-copy-use-after-free
Open

[client] Fix corruption after zero-copy lazy parse ByteBuf#3008
fresh-borzoni wants to merge 1 commit intoapache:mainfrom
fresh-borzoni:fix-indexed-zero-copy-use-after-free

Conversation

@fresh-borzoni
Copy link
Copy Markdown
Contributor

Summary

After #2948, INDEXED/COMPACTED rows reference pooled Netty ByteBuf memory. When DefaultCompletedFetch.drain() releases the buffer, BinaryString fields in returned ScanRecords become dangling references — causing corruption like in https://github.com/apache/fluss/actions/runs/24007394419/job/70013234004?pr=3004

Fix: when building field getters for log record projection, defensively copy STRING/CHAR fields via BinaryString.copy() for formats that reference pooled buffers. ARROW is excluded since VectorizedColumnBatch already produces independent string copies.
The copy flag propagates through nested types (ARRAY, MAP, ROW) so structures like ARRAY are also safe.

@fresh-borzoni fresh-borzoni force-pushed the fix-indexed-zero-copy-use-after-free branch from 9ded936 to b162d4e Compare April 7, 2026 22:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant