Skip to content

HDDS-14759. Local Empty file is written and retained even when key write fails#10707

Merged
sarvekshayr merged 2 commits into
apache:masterfrom
anuragp010:hdds-14759
Jul 10, 2026
Merged

HDDS-14759. Local Empty file is written and retained even when key write fails#10707
sarvekshayr merged 2 commits into
apache:masterfrom
anuragp010:hdds-14759

Conversation

@anuragp010

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

The current behaviour of ozone sh key get /path/to/key localFile when reading from the key fails with an IOException or RuntimeException, results in an empty file, localFile, being created. This file doesn't contain any data and can be deleted.

This PR ensures the empty file created in the above scenario is deleted.

What is the link to the Apache JIRA

https://issues.apache.org/jira/browse/HDDS-14759

How was this patch tested?

Made with Claude Code.

  1. Newly added Unit Tests.

  2. Functional Validation:

Success Scenario:
Screenshot 2026-07-09 at 7 29 51 PM

Failure Scenario:
Screenshot 2026-07-09 at 7 30 16 PM

@adoroszlai adoroszlai left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks @anuragp010 for the patch.

@sarvekshayr sarvekshayr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks @anuragp010 for the fix.

Please address the minor nits in test class.

@anuragp010

Copy link
Copy Markdown
Contributor Author

Thanks @adoroszlai and @sarvekshayr for the review comments, I have addressed them.

@sarvekshayr sarvekshayr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for updating the patch. LGTM.

@sarvekshayr sarvekshayr merged commit cd8ba56 into apache:master Jul 10, 2026
45 checks passed
@sarvekshayr

Copy link
Copy Markdown
Contributor

Thanks @anuragp010 for the patch and @adoroszlai for the review.

@adoroszlai

Copy link
Copy Markdown
Contributor

@anuragp010 Please share text as text, not screenshots. Plain text makes it easier to

  • read (especially for those with visual impairments)
  • reference (e.g. quote)
  • search

It also reduces size to be stored by GitHub.

Sharing code can be even better by using permalink URLs.

@anuragp010

Copy link
Copy Markdown
Contributor Author

@anuragp010 Please share text as text, not screenshots. Plain text makes it easier to

  • read (especially for those with visual impairments)
  • reference (e.g. quote)
  • search

It also reduces size to be stored by GitHub.

Sharing code can be even better by using permalink URLs.

I understand. Will do. Thanks @adoroszlai.

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.

3 participants