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/10/07 07:55:06 UTC

[GitHub] [iceberg] pvary commented on a change in pull request #1559: Core: Update version-hint.txt atomically

pvary commented on a change in pull request #1559:
URL: https://github.com/apache/iceberg/pull/1559#discussion_r500809592



##########
File path: core/src/main/java/org/apache/iceberg/hadoop/HadoopTableOperations.java
##########
@@ -294,13 +294,25 @@ private void writeVersionHint(int versionToWrite) {
     Path versionHintFile = versionHintFile();
     FileSystem fs = getFileSystem(versionHintFile, conf);
 
-    try (FSDataOutputStream out = fs.create(versionHintFile, true /* overwrite */)) {
-      out.write(String.valueOf(versionToWrite).getBytes(StandardCharsets.UTF_8));
+    try {
+      if (fs.exists(versionHintFile)) {
+        Path tempVersionHintFile = metadataPath("version-hint.temp" );

Review comment:
       I would go for an uniq name here so 2 concurrent commits will not interfere




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