apache / amoro

Apache Amoro (incubating) is a Lakehouse management system built on open data lake formats.
https://amoro.apache.org/
Apache License 2.0
847 stars 278 forks source link

[Bug]: When the iceberg table is empty, clean orphan file NPE #2426

Open XiaoGerGer opened 9 months ago

XiaoGerGer commented 9 months ago

What happened?

2023-12-13 01:54:44,591 ERROR [async-orphan-files-cleaning-executor-4] [com.netease.arctic.server.table.executor.OrphanFilesCleaningExecutor] [] - ice-01.ods_bps.ods_ebeb(tableId=677) failed to clean orphan file

java.lang.NullPointerException: null

     at com.netease.arctic.server.optimizing.maintainer.IcebergTableMaintainer.cleanOrphanFiles(IcebergTableMaintainer.java:140) ~[amoro-ams-server-0.7.0-SNAPSHOT.jar:?]

     at com.netease.arctic.server.table.executor.OrphanFilesCleaningExecutor.execute(OrphanFilesCleaningExecutor.java:61) ~[amoro-ams-server-0.7.0-SNAPSHOT.jar:?]

     at com.netease.arctic.server.table.executor.BaseTableExecutor.executeTask(BaseTableExecutor.java:74) ~[amoro-ams-server-0.7.0-SNAPSHOT.jar:?]

     at com.netease.arctic.server.table.executor.BaseTableExecutor.lambda$scheduleIfNecessary$4(BaseTableExecutor.java:83) ~[amoro-ams-server-0.7.0-SNAPSHOT.jar:?]

     at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_392]

     at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_392]

     at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) [?:1.8.0_392]

     at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) [?:1.8.0_392]

     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_392]

     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_392]

     at java.lang.Thread.run(Thread.java:750) [?:1.8.0_392]

Affects Versions

master-snapshot [ at 2023-12-08 ]

What engines are you seeing the problem on?

No response

How to reproduce

No response

Relevant log output

2023-12-13 01:54:44,591 ERROR [async-orphan-files-cleaning-executor-4] [com.netease.arctic.server.table.executor.OrphanFilesCleaningExecutor] [] - ice-01.ods_bps.ods_wl_pcn_batchapplydetail(tableId=677) failed to clean orphan file

java.lang.NullPointerException: null

         at com.netease.arctic.server.optimizing.maintainer.IcebergTableMaintainer.cleanOrphanFiles(IcebergTableMaintainer.java:140) ~[amoro-ams-server-0.7.0-SNAPSHOT.jar:?]

         at com.netease.arctic.server.table.executor.OrphanFilesCleaningExecutor.execute(OrphanFilesCleaningExecutor.java:61) ~[amoro-ams-server-0.7.0-SNAPSHOT.jar:?]

         at com.netease.arctic.server.table.executor.BaseTableExecutor.executeTask(BaseTableExecutor.java:74) ~[amoro-ams-server-0.7.0-SNAPSHOT.jar:?]

         at com.netease.arctic.server.table.executor.BaseTableExecutor.lambda$scheduleIfNecessary$4(BaseTableExecutor.java:83) ~[amoro-ams-server-0.7.0-SNAPSHOT.jar:?]

         at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_392]

         at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_392]

         at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) [?:1.8.0_392]

         at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) [?:1.8.0_392]

         at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_392]

         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_392]

         at java.lang.Thread.run(Thread.java:750) [?:1.8.0_392]

Anything else

No response

Are you willing to submit a PR?

Code of Conduct

klion26 commented 6 months ago

@XiaoGerGer thanks for reporting this, from the code seems the property table is null, could you please share how to reproduce this error, thanks.

github-actions[bot] commented 1 week ago

This issue has been automatically marked as stale because it has been open for 180 days with no activity. It will be closed in next 14 days if no further activity occurs. To permanently prevent this issue from being considered stale, add the label 'not-stale', but commenting on the issue is preferred when possible.