iceberg: "Manifest is missing" ValidationException when there have Concurrent applications to rewrite manifests
we concurrently run a lots of sql-shell to overwrite different day’s data in iceberg table, and every application end with “CALL spark_catalog.system.rewrite_manifests(table => ‘dwm.tableA’, use_caching => false)”. The applications will rewrite the tableA’s manifests concurrently , and throw ValidationException(“Manifest is missing: xxx”) in validateDeletedManifests method.
diagnostics: User class threw exception: org.apache.spark.SparkException: org.apache.iceberg.exceptions.ValidationException: Manifest is missing: oss://xgimi-data/apps/spark/warehouse/ods.db/screen_event_log_hi/metadata/52c1e98f-02a5-4ce3-ae05-d7382a6a68c2-m2.avro at org.apache.iceberg.BaseRewriteManifests.lambda$validateDeletedManifests$7(BaseRewriteManifests.java:261) at java.util.Optional.ifPresent(Optional.java:159) at org.apache.iceberg.BaseRewriteManifests.validateDeletedManifests(BaseRewriteManifests.java:260) at org.apache.iceberg.BaseRewriteManifests.apply(BaseRewriteManifests.java:169) at org.apache.iceberg.SnapshotProducer.apply(SnapshotProducer.java:163) at org.apache.iceberg.BaseRewriteManifests.apply(BaseRewriteManifests.java:53) at org.apache.iceberg.SnapshotProducer.lambda$commit$2(SnapshotProducer.java:276) at org.apache.iceberg.util.Tasks$Builder.runTaskWithRetry(Tasks.java:404) at org.apache.iceberg.util.Tasks$Builder.runSingleThreaded(Tasks.java:213) at org.apache.iceberg.util.Tasks$Builder.run(Tasks.java:197) at org.apache.iceberg.util.Tasks$Builder.run(Tasks.java:189) at org.apache.iceberg.SnapshotProducer.commit(SnapshotProducer.java:275) at org.apache.iceberg.BaseRewriteManifests.commit(BaseRewriteManifests.java:53) at org.apache.iceberg.actions.BaseSnapshotUpdateAction.commit(BaseSnapshotUpdateAction.java:40) at org.apache.iceberg.actions.RewriteManifestsAction.replaceManifests(RewriteManifestsAction.java:309) at org.apache.iceberg.actions.RewriteManifestsAction.execute(RewriteManifestsAction.java:196)
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 5
- Comments: 17 (6 by maintainers)
Commits related to this issue
- core:Optimize log printing in validateDeletedManifests(fix #3466) — committed to kyle-cx91/iceberg by kyle-cx91 5 years ago
- core:Optimize log printing in validateDeletedManifests(fix #3466) improve as suggested from https://github.com/apache/iceberg/pull/4612/files/632ef56a4920f3bc1729967b3826b75d6211d372#r856264100 — committed to kyle-cx91/iceberg by kyle-cx91 5 years ago
- core:Optimize log printing in validateDeletedManifests(fix #3466) improve as suggestion from https://github.com/apache/iceberg/pull/4606#discussion_r857185250 — committed to kyle-cx91/iceberg by kyle-cx91 5 years ago
We were just discussing this today, the message is a bit confusing but is the correct response. I think we should probably change it to something like
“Cannot apply RewriteManifests result since manifests being replaced have already been removed in the current snapshot”
because what is happening actually the same as an other validation error we do during the commit phase. For example, say we run two optimize metadata operations simultaneously
If 1 finishes first the state of our table is
If we try to apply Optimize 2 we see that [A and B] are already deleted and not present, if we added [C’'] our table would look like
And end up with duplicate records! So the correct response is to cancel the 2nd optimize oepration
I got the same issue , my iceberg maintain order is expireSnapshots -> rewriteDataFiles -> rewriteManifests -> deleteOrphanFiles(older than 20 minutes) . The image is rewriteManifests error,but after rewriteDataFiles and before rewriteManifests I have get the currentSnapshot and print the manifest files.
Thanks @372242283 - i know this is still an issue but i saw a pr and was wondering if the pr was abandoned and if so i would like to work on fixing this issue
Would using the DynamoDB lock table help at all with this issue? We have a Spark Streaming job that commits every 3 minutes and a compaction job that runs hourly (rewrite manifests, expire snapshots, rewrite data files) due to an extremely high volume of data ingest. Past a certain point, compaction began failing every time due to the streaming job updating the latest manifest before compaction could complete.
I think I’m going to try the
commit.manifest-merge.enabledsetting and fiddle with commit retries to see if that helps at all. Thanks for everything you do maintaining Iceberg!edit: ^ disabling merge made matters a bit worse, would not recommend. We’re going to try calling rewriteManifests less often and wrap it in some application level retries for now.
I have the same problem, which happens occasionally,big guys, help me analyze it Thank you: version:iceberg1.1.0,spark3.1.3 CALL hive_catalog.system.rewrite_manifests(‘xx.tableA’, false) ERROR Msg: 23/02/05 21:12:04 INFO KubernetesClusterSchedulerBackend$KubernetesDriverEndpoint: Asking each executor to shut down 23/02/05 21:12:04 WARN ExecutorPodsWatchSnapshotSource: Kubernetes client has been closed (this is expected if the application is shutting down.) 23/02/05 21:12:05 INFO MapOutputTrackerMasterEndpoint: MapOutputTrackerMasterEndpoint stopped! 23/02/05 21:12:05 INFO MemoryStore: MemoryStore cleared 23/02/05 21:12:05 INFO BlockManager: BlockManager stopped 23/02/05 21:12:05 INFO BlockManagerMaster: BlockManagerMaster stopped 23/02/05 21:12:05 INFO OutputCommitCoordinator$OutputCommitCoordinatorEndpoint: OutputCommitCoordinator stopped! 23/02/05 21:12:05 INFO SparkContext: Successfully stopped SparkContext Exception in thread “main” org.apache.iceberg.exceptions.ValidationException: Manifest is missing: hdfs://xxx:8020/user/hive/warehouse/xx.db/tableA/metadata/d9c19289-fbf1-48a8-90be-a8eecdf088b4-m0.avro at org.apache.iceberg.BaseRewriteManifests.lambda$validateDeletedManifests$7(BaseRewriteManifests.java:299) at java.base/java.util.Optional.ifPresent(Unknown Source) at org.apache.iceberg.BaseRewriteManifests.validateDeletedManifests(BaseRewriteManifests.java:297) at org.apache.iceberg.BaseRewriteManifests.apply(BaseRewriteManifests.java:195) at org.apache.iceberg.SnapshotProducer.apply(SnapshotProducer.java:223) at org.apache.iceberg.BaseRewriteManifests.apply(BaseRewriteManifests.java:50) at org.apache.iceberg.SnapshotProducer.lambda$commit$2(SnapshotProducer.java:369) at org.apache.iceberg.util.Tasks$Builder.runTaskWithRetry(Tasks.java:402) at org.apache.iceberg.util.Tasks$Builder.runSingleThreaded(Tasks.java:212) at org.apache.iceberg.util.Tasks$Builder.run(Tasks.java:196) at org.apache.iceberg.util.Tasks$Builder.run(Tasks.java:189) at org.apache.iceberg.SnapshotProducer.commit(SnapshotProducer.java:367) at org.apache.iceberg.BaseRewriteManifests.commit(BaseRewriteManifests.java:50) at org.apache.iceberg.spark.actions.BaseSnapshotUpdateSparkAction.commit(BaseSnapshotUpdateSparkAction.java:43) at org.apache.iceberg.spark.actions.BaseRewriteManifestsSparkAction.replaceManifests(BaseRewriteManifestsSparkAction.java:312) at org.apache.iceberg.spark.actions.BaseRewriteManifestsSparkAction.doExecute(BaseRewriteManifestsSparkAction.java:185) at org.apache.iceberg.spark.actions.BaseSparkAction.withJobGroupInfo(BaseSparkAction.java:97) at org.apache.iceberg.spark.actions.BaseRewriteManifestsSparkAction.execute(BaseRewriteManifestsSparkAction.java:150) at org.apache.iceberg.spark.actions.BaseRewriteManifestsSparkAction.execute(BaseRewriteManifestsSparkAction.java:80) at org.apache.iceberg.spark.procedures.RewriteManifestsProcedure.lambda$call$0(RewriteManifestsProcedure.java:97) at org.apache.iceberg.spark.procedures.BaseProcedure.execute(BaseProcedure.java:86) at org.apache.iceberg.spark.procedures.BaseProcedure.modifyIcebergTable(BaseProcedure.java:74) at org.apache.iceberg.spark.procedures.RewriteManifestsProcedure.call(RewriteManifestsProcedure.java:88) at org.apache.spark.sql.execution.datasources.v2.CallExec.run(CallExec.scala:33) at org.apache.spark.sql.execution.datasources.v2.V2CommandExec.result$lzycompute(V2CommandExec.scala:40) at org.apache.spark.sql.execution.datasources.v2.V2CommandExec.result(V2CommandExec.scala:40) at org.apache.spark.sql.execution.datasources.v2.V2CommandExec.executeCollect(V2CommandExec.scala:46) at org.apache.spark.sql.Dataset.$anonfun$logicalPlan$1(Dataset.scala:228) at org.apache.spark.sql.Dataset.$anonfun$withAction$1(Dataset.scala:3700) at org.apache.spark.sql.execution.SQLExecution$.$anonfun$withNewExecutionId$5(SQLExecution.scala:103) at org.apache.spark.sql.execution.SQLExecution$.withSQLConfPropagated(SQLExecution.scala:163) at org.apache.spark.sql.execution.SQLExecution$.$anonfun$withNewExecutionId$1(SQLExecution.scala:90) at org.apache.spark.sql.SparkSession.withActive(SparkSession.scala:775) at org.apache.spark.sql.execution.SQLExecution$.withNewExecutionId(SQLExecution.scala:64)
I think put the current-snapshot-id into the error message would make it easier for the user to figure out what happened.