You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by GitBox <gi...@apache.org> on 2020/12/03 17:20:51 UTC

[GitHub] [iceberg] rdblue commented on a change in pull request #1871: Add Atomic Write support for Hadoop Tables

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:
users@infra.apache.org



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