Skip to content

Conversation

@ChenSammi
Copy link
Contributor

@ChenSammi ChenSammi commented Jan 16, 2026

What changes were proposed in this pull request?

Provide a one-liner summary of the changes in the PR Title field above.
It should be in the form of HDDS-1234. Short summary of the change.

Please describe your PR in detail:

  • What changes are proposed in the PR? and Why? It would be better if it is written from third person's
    perspective not just for the reviewer.
  • Provide as much context and rationale for the pull request as possible. It could be copy-paste from
    the Jira's description if the jira is well defined.
  • If it is complex code, describe the approach used to solve the issue. If possible attach design doc,
    issue investigation, github discussion, etc.

Examples of well-written pull requests:

What is the link to the Apache JIRA

Please create an issue in ASF JIRA before opening a pull request, and you need to set the title of the pull
request which starts with the corresponding JIRA issue number. (e.g. HDDS-XXXX. Fix a typo in YYY.)

(Please replace this section with the link to the Apache JIRA)

How was this patch tested?

(Please explain how this patch was tested. Ex: unit tests, manual tests, workflow run on the fork git repo.)
(If this patch involves UI changes, please attach a screenshot; otherwise, remove this.)

@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
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.

1 participant