wankunde opened a new pull request, #12156:
URL: https://github.com/apache/gluten/pull/12156

   ## What changes are proposed in this pull request?
   
   Bug fix for `VeloxHashShuffleWriter::doSplit`.
   
   How does this issue happen :
   * After set `splitState_ == kInit`, do `evictPartitionBuffers()` to evict 
large partitions.
   * `evictPartitionBuffers(pid)` calls assembleBuffers, which slices / copies 
/ serializes buffers and may allocate from the Velox memory pool. 
   * The allocation can trigger memory arbitration, which calls back into 
`reclaimFixedSize`. 
   * Because `evictState_` is still `kEvictable` and 
`evictPartitionBuffersAfterSpill()` is true, the arbitrator enters 
`evictPartitionBuffersMinSize`, which may select the same pid we are currently 
evicting. 
   * The inner eviction resets `partitionBuffers_[*][pid]`, 
`partitionBinaryAddrs_[*][pid]`, and `partitionBufferBase_[pid]` while the 
outer call is still mid-assembly.
   
   How to fix this issue:
   * Do do `evictPartitionBuffers()` before set `splitState_ == kInit`
   
   ## How was this patch tested?
   
   Use exists UT
   
   ## Was this patch authored or co-authored using generative AI tooling?
    
   NO
   


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