puchengy opened a new issue, #12499:
URL: https://github.com/apache/iceberg/issues/12499

   ### Apache Iceberg version
   
   1.3.0
   
   ### Query engine
   
   Spark
   
   ### Please describe the bug 🐞
   
   When OOM happens with IRC successful commits, Spark will mistakenly cleanup 
committed file cause table to be corrupted. I have checked main branch code and 
it seems the issue could still be there. Please correct me if I am missing some 
patches upstream. Using Spark 3.2 + Iceberg 1.3.0
   
   ```
   java.lang.OutOfMemoryError: Java heap space
        at java.util.Arrays.copyOfRange(Arrays.java:3664)
        at java.lang.String.<init>(String.java:207)
        at 
org.apache.hc.core5.util.CharArrayBuffer.toString(CharArrayBuffer.java:493)
        at 
org.apache.hc.core5.http.io.entity.EntityUtils.toString(EntityUtils.java:222)
        at 
org.apache.hc.core5.http.io.entity.EntityUtils.toString(EntityUtils.java:283)
        at 
org.apache.hc.core5.http.io.entity.EntityUtils.toString(EntityUtils.java:325)
        at 
org.apache.hc.core5.http.io.entity.EntityUtils.toString(EntityUtils.java:303)
        at 
org.apache.iceberg.rest.HTTPClient.extractResponseBodyAsString(HTTPClient.java:108)
        at org.apache.iceberg.rest.HTTPClient.execute(HTTPClient.java:281)
        at org.apache.iceberg.rest.HTTPClient.execute(HTTPClient.java:219)
        at org.apache.iceberg.rest.HTTPClient.post(HTTPClient.java:330)
        at org.apache.iceberg.rest.RESTClient.post(RESTClient.java:112)
        at 
org.apache.iceberg.rest.RESTTableOperations.commit(RESTTableOperations.java:144)
        at 
org.apache.iceberg.SnapshotProducer.lambda$commit$2(SnapshotProducer.java:390)
        at 
org.apache.iceberg.SnapshotProducer$$Lambda$4328/1173191896.run(Unknown Source)
        at 
org.apache.iceberg.util.Tasks$Builder.runTaskWithRetry(Tasks.java:413)
        at 
org.apache.iceberg.util.Tasks$Builder.runSingleThreaded(Tasks.java:219)
        at org.apache.iceberg.util.Tasks$Builder.run(Tasks.java:203)
        at org.apache.iceberg.util.Tasks$Builder.run(Tasks.java:196)
        at org.apache.iceberg.SnapshotProducer.commit(SnapshotProducer.java:364)
        at 
org.apache.iceberg.BaseOverwriteFiles.commit(BaseOverwriteFiles.java:31)
        at 
org.apache.iceberg.spark.source.SparkWrite.commitOperation(SparkWrite.java:210)
        at 
org.apache.iceberg.spark.source.SparkWrite.access$1300(SparkWrite.java:83)
        at 
org.apache.iceberg.spark.source.SparkWrite$CopyOnWriteOperation.commitWithSerializableIsolation(SparkWrite.java:421)
        at 
org.apache.iceberg.spark.source.SparkWrite$CopyOnWriteOperation.commit(SparkWrite.java:397)
        at 
org.apache.spark.sql.execution.datasources.v2.V2TableWriteExec.writeWithV2(WriteToDataSourceV2Exec.scala:369)
        at 
org.apache.spark.sql.execution.datasources.v2.V2TableWriteExec.writeWithV2$(WriteToDataSourceV2Exec.scala:330)
        at 
org.apache.spark.sql.execution.datasources.v2.ReplaceDataExec.writeWithV2(ReplaceDataExec.scala:29)
        at 
org.apache.spark.sql.execution.datasources.v2.V2ExistingTableWriteExec.run(WriteToDataSourceV2Exec.scala:309)
        at 
org.apache.spark.sql.execution.datasources.v2.V2ExistingTableWriteExec.run$(WriteToDataSourceV2Exec.scala:308)
        at 
org.apache.spark.sql.execution.datasources.v2.ReplaceDataExec.run(ReplaceDataExec.scala:29)
        at 
org.apache.spark.sql.execution.datasources.v2.V2CommandExec.result$lzycompute(V2CommandExec.scala:43)
   ```
   
   ### Willingness to contribute
   
   - [ ] I can contribute a fix for this bug independently
   - [x] I would be willing to contribute a fix for this bug with guidance from 
the Iceberg community
   - [ ] I cannot contribute a fix for this bug at this time


-- 
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: issues-unsubscr...@iceberg.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org
For additional commands, e-mail: issues-h...@iceberg.apache.org

Reply via email to