HDDS-14417. Skip wrapping allocated but unused blocks for empty file as pseudo file and save in deletedTable#9639
Merged
ChenSammi merged 1 commit intoapache:masterfrom Jan 20, 2026
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR addresses issue HDDS-14417 by skipping the creation of pseudo files for allocated but unused blocks when committing empty files. The change prevents unnecessary entries in the deleted table for files with zero data size.
Changes:
- Modified the
wrapUncommittedBlocksAsPseudoKey()method to return null when the file's data size is 0, even if there are uncommitted blocks - Added test coverage for empty file scenarios in both regular key commit and S3 multipart upload commit operations
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/key/OMKeyRequest.java | Added condition to skip wrapping uncommitted blocks when data size is 0 |
| hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/request/key/TestOMKeyCommitRequest.java | Added test for empty file with pre-allocated uncommitted blocks |
| hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/request/s3/multipart/TestS3MultipartUploadCommitPartRequest.java | Added test for empty multipart upload part with uncommitted blocks |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
ivandika3
approved these changes
Jan 17, 2026
priyeshkaratha
approved these changes
Jan 19, 2026
Contributor
priyeshkaratha
left a comment
There was a problem hiding this comment.
Thanks @ChenSammi for working on this. Changes LGTM
ashishkumar50
approved these changes
Jan 19, 2026
Contributor
ashishkumar50
left a comment
There was a problem hiding this comment.
@ChenSammi Thanks for the fix, LGTM.
7e3a482 to
19c638f
Compare
…as pseudo file and save in deletedTable
Contributor
Author
|
Thanks @ivandika3 @priyeshkaratha @ashishkumar50 for the review. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this pull request?
Skip wrapping allocated but unused blocks for empty file as pseudo file and save in deletedTable
What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-14417
How was this patch tested?
New unit tests.