-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Use createOrOverwrite to create transaction log files on s3 #20945
Use createOrOverwrite to create transaction log files on s3 #20945
Conversation
outputStream.write(entryContents); | ||
} | ||
// write transaction log entry atomically by keeping in mind that S3 does not support creating files exclusively | ||
fileSystem.newOutputFile(newLogEntryPath).createOrOverwrite(entryContents); |
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.
This no longer creates an empty file, right?
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.
No, the creation or overwrite (s3 does not allow exclusive file writing) should be atomic.
The concern was actually here not to have it half-baked - containing not all the bytes of the content.
/test-with-secrets sha=e3fcd2514570cc0cc7a3ad3f1ab4b8ac216a9fc7 |
The CI workflow run with tests that require additional secrets has been started: https://github.com/trinodb/trino/actions/runs/8164693715 |
Description
Follow-up work for e178494 to ensure that transaction log files are written atomically on S3 for Delta Lake in order to avoid to end up on the storage half-baked (leading to table corruption).
Additional context and related issues
#20913
Release notes
(x) This is not user-visible or is docs only, and no release notes are required.