Skip to content

Conversation

@rdblue
Copy link
Contributor

@rdblue rdblue commented Feb 3, 2020

#695 had a test failure because a Hadoop table had out of date metadata, even though there were no commits. The problem is that metadata is loaded into a new TableMetadata object each time refresh is called, even if it was already loaded and is still current. This adds a check when the current version is determined to avoid unnecessary reloads.

@prodeezy
Copy link
Contributor

prodeezy commented Feb 4, 2020

nice catch! 2 failures that seem related:

org.apache.iceberg.hadoop.TestHadoopCommits > testRenameThrow FAILED
    org.apache.iceberg.exceptions.ValidationException at TestHadoopCommits.java:360
org.apache.iceberg.hadoop.TestHadoopCommits > testRenameReturnFalse FAILED
    org.apache.iceberg.exceptions.ValidationException at TestHadoopCommits.java:360

@aokolnychyi
Copy link
Contributor

LGTM as we have similar logic for Hive tables. Test failures seem relevant. @rdblue, could you check?

@rdblue rdblue force-pushed the fix-unnecessary-reload branch from 915117f to 1f97ce9 Compare February 4, 2020 17:43
@rdblue
Copy link
Contributor Author

rdblue commented Feb 4, 2020

Test failures had two causes. First, shouldRefresh wasn't reset correctly. Second, use of a spy prevented the table from loading the correct metadata because the mocked FS wasn't returning correct results. The test only worked in the first place because of this bug, which would reload v1 metadata as a different object so the operations would attempt to commit and trigger the injected failure.

@rdblue
Copy link
Contributor Author

rdblue commented Feb 4, 2020

Looks like style check failed:

[ant:checkstyle] [ERROR] /home/travis/build/apache/incubator-iceberg/core/src/test/java/org/apache/iceberg/hadoop/TestHadoopCommits.java:29:8: Unused import - org.apache.hadoop.conf.Configuration. [UnusedImports]

[ant:checkstyle] [ERROR] /home/travis/build/apache/incubator-iceberg/core/src/test/java/org/apache/iceberg/hadoop/TestHadoopCommits.java:31:8: Unused import - org.apache.hadoop.fs.Path. [UnusedImports]

[ant:checkstyle] [ERROR] /home/travis/build/apache/incubator-iceberg/core/src/test/java/org/apache/iceberg/hadoop/TestHadoopCommits.java:56:15: Unused import - org.mockito.Mockito.spy. [UnusedImports]

@rdblue rdblue force-pushed the fix-unnecessary-reload branch from 1f97ce9 to 560734e Compare February 4, 2020 18:39
Copy link
Contributor

@aokolnychyi aokolnychyi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

@aokolnychyi aokolnychyi merged commit 4b5a789 into apache:master Feb 4, 2020
@aokolnychyi
Copy link
Contributor

Thanks, @rdblue!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants