Skip to content

Conversation

@ChenSammi
Copy link
Contributor

@ChenSammi ChenSammi commented Jan 16, 2026

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.

@ChenSammi ChenSammi requested a review from Copilot January 16, 2026 09:42
@ChenSammi ChenSammi changed the title HDDS-14417. Skip wrapping allocated but unused blocks for empty file … HDDS-14417. Skip wrapping allocated but unused blocks for empty file as pseudo file and save in deletedTable Jan 16, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 ivandika3 self-requested a review January 16, 2026 09:57
Copy link
Contributor

@ivandika3 ivandika3 left a comment

Choose a reason for hiding this comment

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

Thanks for the patch. LGTM +1.

Could you help update the PR descriptions?

Copy link
Contributor

@priyeshkaratha priyeshkaratha left a comment

Choose a reason for hiding this comment

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

Thanks @ChenSammi for working on this. Changes LGTM

Copy link
Contributor

@ashishkumar50 ashishkumar50 left a comment

Choose a reason for hiding this comment

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

@ChenSammi Thanks for the fix, LGTM.

@ChenSammi ChenSammi force-pushed the HDDS-14417 branch 2 times, most recently from 7e3a482 to 19c638f Compare January 19, 2026 07:56
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