Skip to content

Conversation

@priyeshkaratha
Copy link
Contributor

@priyeshkaratha priyeshkaratha commented Jan 14, 2026

What changes were proposed in this pull request?

When OM sends block deletion requests to SCM we can skip it if deleted blocklists are empty for the blockgroup. It indicates its delete request for empty file. So that we can also make sure fast deletion for keys that created with empty sizes.

What is the link to the Apache JIRA

HDDS-14418

How was this patch tested?

Tested locally using creating 1 empty file and 1 normal file and deleted both files. 1 file git skipped as per requirement.
CI is green

@priyeshkaratha priyeshkaratha marked this pull request as ready for review January 14, 2026 07:33
@ChenSammi
Copy link
Contributor

ChenSammi commented Jan 14, 2026

@priyeshkaratha , can you add a unit test for this case? Manual test is good, but unit test is more preferred if not too difficult to create a new unit test.

keyBlocksList.size(), logSize, keyBlocksList.entrySet().stream().limit(logSize)
LOG.info("Send {} key(s) to SCM (filtered {} empty files), first {} keys: {}",
nonEmptyKeyBlocksList.size(), keyBlocksList.size() - nonEmptyKeyBlocksList.size(), logSize,
nonEmptyKeyBlocksList.entrySet().stream().limit(logSize)
Copy link
Contributor

Choose a reason for hiding this comment

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

These empty files can happen mostly in testing, No need to update normal logs to avoid confusion. Instead please add separate debug log if any empty files/blocks are present.

Copy link
Contributor

@sadanand48 sadanand48 Jan 14, 2026

Choose a reason for hiding this comment

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

+1. Lets keep them logged as DEBUG. Also probably use 'keys' instead of 'files' to maintain uniformity while logging

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for reviewing the changes. Addressed the changes mentioned.

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