wecharyu opened a new issue, #13845:
URL: https://github.com/apache/gluten/issues/13845
### Backend
VL (Velox)
### Bug description
We found a gluten job's shuffle map stage that included a
`ColumnarPartialProject` RDD failed, all tasks failed in deserializing the
broadcast task binary and allocating Catalyst `AttributeReference` objects:
```text
java.io.InvalidClassException:
org.apache.spark.sql.catalyst.expressions.AttributeReference
at org.apache.spark.serializer.JavaDeserializationStream.readObject(...)
at org.apache.spark.serializer.JavaSerializerInstance.deserialize(...)
at org.apache.spark.scheduler.ShuffleMapTask.runTask(...)
Caused by: java.lang.OutOfMemoryError: GC overhead limit exceeded
```
## Root Cause
In `ColumnarPartialProjectExec.doExecuteColumnar`, the `mapPartitions`
closure reads instance fields and calls `getProjectedBatchArrow` on the
enclosing operator. Java serialization therefore traverses the operator and its
`child` plan. Spark broadcasts the serialized RDD and shuffle dependency, and
each task deserializes its own copy. This capture can multiply JVM heap usage
across concurrent tasks especially when the `child` plan is huge.
## Affected operators
| Operators | How the task closure captures the child plan |
| --- | --- |
| `ColumnarPartialProjectExec` | The partition closure reads projection
fields and calls `getProjectedBatchArrow` on the enclosing operator. |
| `ColumnarPartialGenerateExec` | The partition closure reads generator
fields and calls instance methods to produce batches. |
| `ColumnarArrowEvalPythonExec` | The partition closure reads `udfs` and
accesses `child.output` through the operator. |
| `ColumnarCollectLimitExec`, `CHColumnarCollectLimitExec`,
`ColumnarCollectTailExec`, `CHColumnarCollectTailExec` | The shared columnar
paths call `collectWithOffsetAndLimit` or `collectTailRows` on the enclosing
operator. |
| `LoadArrowDataExec`, `OffloadArrowDataExec`,
`ArrowColumnarToVeloxColumnarExec`, `ArrowColumnarToBoltColumnarExec`,
`VeloxResizeBatchesExec`, `BoltResizeBatchesExec`,
`GpuResizeBufferColumnarBatchExec`, `GlutenDeltaInvariantCheckerExec` | The
inherited `ColumnarToColumnarExec` closure calls `mapIterator` and
`closeIterator` on the enclosing operator. |
### Gluten version
_No response_
### Spark version
None
### Spark configurations
_No response_
### System information
_No response_
### Relevant logs
```bash
```
--
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]