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/09/14 08:25:33 UTC
[GitHub] [iceberg] pvary commented on a change in pull request #1443: Core: Fix table load error on corrupted version-hint.text file
pvary commented on a change in pull request #1443:
URL: https://github.com/apache/iceberg/pull/1443#discussion_r487736815
##########
File path: core/src/main/java/org/apache/iceberg/hadoop/HadoopTableOperations.java
##########
@@ -290,8 +292,10 @@ private int readVersionHint() {
return Integer.parseInt(in.readLine().replace("\n", ""));
}
- } catch (IOException e) {
- throw new RuntimeIOException(e, "Failed to get file system for path: %s", versionHintFile);
+ } catch (Exception e) {
+ LOG.warn("Error reading version hint file {}", versionHintFile, e);
+ // We just assume corrupted metadata and start to read from the first version file
+ return 1;
Review comment:
When we are returning 0 the caller will end up throwing the following exception:
```
Table does not exist: tbl
org.apache.iceberg.exceptions.NoSuchTableException: Table does not exist: tbl
at org.apache.iceberg.BaseMetastoreCatalog.loadTable(BaseMetastoreCatalog.java:108)
at org.apache.iceberg.hadoop.TestHadoopCatalog.testVersionHintFile(TestHadoopCatalog.java:508)
```
The goal of the PR is to recover from the corrupted version-hint.txt file, so I have returned 1 instead.
But this question made me wonder if returning 1 is a good idea or not, so I will check with Ryan
----------------------------------------------------------------
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