-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Properly handle failed attempts to delete a file in Hive connector #12314
Conversation
@@ -2247,7 +2248,10 @@ private void finishOptimize(ConnectorSession session, ConnectorTableExecuteHandl | |||
if (firstScannedPath.isEmpty()) { | |||
firstScannedPath = Optional.of(scannedPath); | |||
} | |||
retry().run("delete " + scannedPath, () -> fs.delete(scannedPath, false)); | |||
retry().run("delete " + scannedPath, () -> { |
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.
Can we have an integration test based on minio showcasing this fix?
https://docs.min.io/docs/minio-multi-user-quickstart-guide.html
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.
Would be nice - but I do not have resources to do that.
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.
Also the tricky part is that this delete
call spots themselves are in error handling code paths - which would make test setup cumbersome.
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.
LGTM but let's wait a bit in case ignoring delete status was deliberate. Let's give a chance for folks to chime in.
Relates to: #12306
"Fixes"?
If we want an exception - then yeah - I would say it fixes it.\
Actually no - different code path.
plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/FileSystemHelper.java
Outdated
Show resolved
Hide resolved
3b76f9d
to
3e58eb9
Compare
Description
bugfix
Hive connector
Related issues, pull requests, and links
Relates to: #12306
Fixes: #12296
Documentation
(x) No documentation is needed.
( ) Sufficient documentation is included in this PR.
( ) Documentation PR is available with #prnumber.
( ) Documentation issue #issuenumber is filed, and can be handled later.
Release notes
( ) No release notes entries required.
(x) Release notes entries required with the following suggested text: