-
Notifications
You must be signed in to change notification settings - Fork 489
Fix storage and containment validation for registerView #4963
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1080,6 +1080,9 @@ public View registerView(TableIdentifier identifier, String metadataFileLocation | |
| throw new IllegalStateException( | ||
| String.format("Failed to fetch resolved parent for TableIdentifier '%s'", identifier)); | ||
| } | ||
|
|
||
| validateLocationForTableLike(identifier, metadataFileLocation, resolvedParent); | ||
|
|
||
| FileIO fileIO = | ||
| loadFileIOForTableLike( | ||
| identifier, | ||
|
|
@@ -1090,6 +1093,8 @@ public View registerView(TableIdentifier identifier, String metadataFileLocation | |
|
|
||
| InputFile metadataFile = fileIO.newInputFile(metadataFileLocation); | ||
| ViewMetadata metadata = ViewMetadataParser.read(metadataFile); | ||
| validateLocationForTableLike(identifier, metadata.location(), resolvedParent); | ||
| validateMetadataFileInTableDir(identifier, metadata.location(), metadataFileLocation); | ||
| ops.commit(null, metadata); | ||
|
Comment on lines
1084
to
1098
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I noticed this while writing the tests— Since this exact same split-brain configuration bug currently exists for I plan to chase that separately if people agree that ain't deliberate rather than expanding the scope here
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
This looks like a bug to me. Do you mind opening an issue for this? |
||
|
|
||
| return new BaseView(ops, ViewUtil.fullViewName(name(), identifier)); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you also need to call
validateLocationForTableLike– themetadata.location()value must be valid wrt to the storage configuration from the table hierarchy, AND wrt to the table directory, if escaping the directory is not allowed: