{"record":{"id":"c353c879f31e417a","repo":"apache/iceberg","slug":"cannot-commit-s-because-glue-detected-concurrent","errorCode":null,"errorMessage":"Cannot commit %s because Glue detected concurrent update","messagePattern":"Cannot commit (.+?) because Glue detected concurrent update","errorType":"exception","errorClass":"CommitFailedException","httpStatus":null,"severity":"error","filePath":"aws/src/main/java/org/apache/iceberg/aws/glue/GlueTableOperations.java","lineNumber":355,"sourceCode":"              .overrideConfiguration(c -> c.addMetricPublisher(retryDetector))\n              .catalogId(awsProperties.glueCatalogId())\n              .databaseName(databaseName)\n              .tableInput(\n                  TableInput.builder()\n                      .applyMutation(\n                          builder ->\n                              IcebergToGlueConverter.setTableInputInformation(builder, metadata))\n                      .name(tableName)\n                      .tableType(GLUE_EXTERNAL_TABLE_TYPE)\n                      .parameters(parameters)\n                      .build())\n              .build());\n    }\n  }\n\n  private void handleAWSExceptions(AwsServiceException persistFailure) {\n    if (persistFailure instanceof ConcurrentModificationException) {\n      throw new CommitFailedException(\n          persistFailure, \"Cannot commit %s because Glue detected concurrent update\", tableName());\n    } else if (persistFailure\n        instanceof software.amazon.awssdk.services.glue.model.AlreadyExistsException) {\n      throw new AlreadyExistsException(\n          persistFailure,\n          \"Cannot commit %s because its Glue table already exists when trying to create one\",\n          tableName());\n    } else if (persistFailure instanceof EntityNotFoundException) {\n      throw new NotFoundException(\n          persistFailure,\n          \"Cannot commit %s because Glue cannot find the requested entity\",\n          tableName());\n    } else if (persistFailure instanceof AccessDeniedException) {\n      throw new ForbiddenException(\n          persistFailure,\n          \"Cannot commit %s because Glue cannot access the requested resources\",\n          tableName());\n    } else if (persistFailure","sourceCodeStart":337,"sourceCodeEnd":373,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/aws/src/main/java/org/apache/iceberg/aws/glue/GlueTableOperations.java#L337-L373","documentation":"CommitFailedException thrown by GlueTableOperations.handleAWSExceptions when the AWS Glue UpdateTable call fails with ConcurrentModificationException. Glue itself detected that the table was modified between its GetTable and UpdateTable calls, so the conditional update was rejected to prevent lost updates. It is a retryable commit failure from the catalog side.","triggerScenarios":"doCommit → persistGlueTable → glue.updateTable raises software.amazon.awssdk.services.glue.model.ConcurrentModificationException because another client updated the Glue table concurrently.","commonSituations":"Multiple Iceberg writers committing to the same table at the same moment; external processes (Crawlers, Athena DDL) touching the Glue table while an Iceberg commit is in flight; high-frequency commits from a streaming job overlapping with compaction.","solutions":["Retry the operation — this is a transient conflict and Iceberg's commit retry will refresh metadata and re-commit.","Reduce commit contention: batch appends, increase checkpoint intervals in Flink/Spark streaming, or stagger scheduled maintenance jobs.","Check for non-Iceberg actors (Glue Crawlers, Terraform, manual console edits) modifying the table and exclude the table from them."],"exampleFix":"// before\nstreamingQuery.trigger(ProcessingTime(\"1 second\")); // very frequent commits -> Glue conflicts\n// after\nstreamingQuery.trigger(ProcessingTime(\"1 minute\")); // fewer, batched commits reduce concurrent update conflicts","handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  table.commit();\n} catch (CommitFailedException e) {\n  // Glue ConcurrentModificationException: back off and retry\n  Thread.sleep(backoffMs);\n  table.refresh();\n  table.commit();\n}","preventionTips":["Increase streaming checkpoint/commit intervals to reduce commit frequency","Schedule compaction away from peak writer traffic","Exclude Iceberg-managed tables from Glue Crawlers and manual edits","Use Iceberg's automatic retry configuration instead of one-shot commits"],"tags":["aws","glue","commit","concurrency","retryable"],"backgroundTag":"concurrent-commit-conflict","analyzedSha":"86d9c8fc543e7c56c9f624eb725f76c9baff9570","analyzedAt":"2026-09-12T00:46:39.097Z","contentChangedAt":"2026-09-12T00:46:39.097Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}