wForget opened a new issue, #2814:
URL: https://github.com/apache/uniffle/issues/2814

   ### Code of Conduct
   
   - [x] I agree to follow this project's [Code of 
Conduct](https://www.apache.org/foundation/policies/conduct)
   
   
   ### Search before asking
   
   - [x] I have searched in the 
[issues](https://github.com/apache/incubator-uniffle/issues?q=is%3Aissue) and 
found no similar issues.
   
   
   ### Describe the bug
   
   When overlapping decompression is enabled, reading a shuffle data batch 
converts the same underlying `ManagedBuffer` to a `ByteBuffer` twice:
   
   1. `ShuffleReadClientImpl.read()` obtains `readBuffer` through 
`getDataBuffer()`.
   2. `DecompressionWorker.add()` calls `getDataBuffer()` again for 
decompression.
   
   Both calls delegate to `NettyManagedBuffer.nioByteBuffer()` → 
`ByteBuf.nioBuffer()`. When the underlying `CompositeByteBuf` requires merging 
multiple NIO buffers, each call allocates a new `HeapByteBuffer` and copies the 
entire readable payload.
   
   The following allocation stacks were captured from an affected build. Line 
numbers and call order may differ from the current master.
   
   Through `DecompressionWorker.add()`:
   
   ```text
   java.nio.HeapByteBuffer.<init>(HeapByteBuffer.java:57)
   java.nio.ByteBuffer.allocate(ByteBuffer.java:335)
   
org.apache.uniffle.shaded.io.netty.buffer.CompositeByteBuf.nioBuffer(CompositeByteBuf.java:1685)
   
org.apache.uniffle.shaded.io.netty.buffer.AbstractByteBuf.nioBuffer(AbstractByteBuf.java:1231)
   
org.apache.uniffle.common.netty.buffer.NettyManagedBuffer.nioByteBuffer(NettyManagedBuffer.java:48)
   
org.apache.uniffle.common.ShuffleDataResult.getDataBuffer(ShuffleDataResult.java:90)
   
org.apache.uniffle.client.impl.DecompressionWorker.add(DecompressionWorker.java:94)
   
org.apache.uniffle.client.impl.ShuffleReadClientImpl.read(ShuffleReadClientImpl.java:377)
   
org.apache.uniffle.client.impl.ShuffleReadClientImpl.readShuffleBlockData(ShuffleReadClientImpl.java:254)
   
org.apache.spark.shuffle.reader.RssShuffleDataIterator.hasNext(RssShuffleDataIterator.java:145)
   org.apache.spark.util.CompletionIterator.hasNext(CompletionIterator.scala:31)
   
org.apache.spark.shuffle.reader.RssShuffleReader$MultiPartitionIterator.hasNext(RssShuffleReader.java:428)
   ```
   
   Directly through `ShuffleReadClientImpl.read()`:
   
   ```text
   java.nio.HeapByteBuffer.<init>(HeapByteBuffer.java:57)
   java.nio.ByteBuffer.allocate(ByteBuffer.java:335)
   
org.apache.uniffle.shaded.io.netty.buffer.CompositeByteBuf.nioBuffer(CompositeByteBuf.java:1685)
   
org.apache.uniffle.shaded.io.netty.buffer.AbstractByteBuf.nioBuffer(AbstractByteBuf.java:1231)
   
org.apache.uniffle.common.netty.buffer.NettyManagedBuffer.nioByteBuffer(NettyManagedBuffer.java:48)
   
org.apache.uniffle.common.ShuffleDataResult.getDataBuffer(ShuffleDataResult.java:90)
   
org.apache.uniffle.client.impl.ShuffleReadClientImpl.read(ShuffleReadClientImpl.java:383)
   
org.apache.uniffle.client.impl.ShuffleReadClientImpl.readShuffleBlockData(ShuffleReadClientImpl.java:254)
   
org.apache.spark.shuffle.reader.RssShuffleDataIterator.hasNext(RssShuffleDataIterator.java:145)
   org.apache.spark.util.CompletionIterator.hasNext(CompletionIterator.scala:31)
   
org.apache.spark.shuffle.reader.RssShuffleReader$MultiPartitionIterator.hasNext(RssShuffleReader.java:428)
   ```
   
   ### Affects Version(s)
   
   master
   
   ### Uniffle Server Log Output
   
   ```logtalk
   
   ```
   
   ### Uniffle Engine Log Output
   
   ```logtalk
   
   ```
   
   ### Uniffle Server Configurations
   
   ```yaml
   
   ```
   
   ### Uniffle Engine Configurations
   
   ```yaml
   
   ```
   
   ### Additional context
   
   _No response_
   
   ### Are you willing to submit PR?
   
   - [x] Yes I am willing to submit a PR!


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