rdblue commented on a change in pull request #1871:
URL: https://github.com/apache/iceberg/pull/1871#discussion_r535431178



##########
File path: 
core/src/main/java/org/apache/iceberg/hadoop/HadoopTableOperations.java
##########
@@ -161,8 +163,24 @@ public void commit(TableMetadata base, TableMetadata 
metadata) {
           "Failed to check if next version exists: %s", finalMetadataFile);
     }
 
-    // this rename operation is the atomic commit operation
-    renameToFinal(fs, tempMetadataFile, finalMetadataFile);
+    if (useAtomicWrite) {
+      // using atomic write
+      try {
+        TableMetadataParser.write(metadata, 
io().newOutputFile(finalMetadataFile.toString()));
+      } catch (RuntimeIOException e) {
+        CommitFailedException cfe = new CommitFailedException(
+                "Failed to commit changes using atomic write: %s", 
finalMetadataFile.toString());

Review comment:
       How do you know that the `RuntimeIOException` indicates a write 
conflict? Should we support a conflict exception in the `FileIO` that can be 
thrown instead?




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to