Skip to content

HDDS-17502. Report purgeable bytes split by deleted keys and directories in GetBucketDeletedBytes - #11799

Merged
priyeshkaratha merged 2 commits into
apache:masterfrom
priyeshkaratha:HDDS-17502
Oct 29, 2026
Merged

priyeshkaratha merged 2 commits into
apache:masterfrom
priyeshkaratha:HDDS-17502

Conversation

@priyeshkaratha

Copy link
Copy Markdown
Member

What changes were proposed in this pull request?

BucketDeletedDataCalculator added bytes of deleted-table entries and of files under deleted directories into one purgeableBytes total, so callers could not tell the two apart.

Track purgeableKeyBytes and purgeableDirBytes separately and return them as new optional fields in GetBucketDeletedBytesResponse. purgeableBytes is still their sum. The client returns -1 for both when an older OM does not send them.

What is the link to the Apache JIRA

HDDS-17502

How was this patch tested?

updated test cases.

assertEquals(1L, stats.getPurgeableKeys());
assertEquals(0L, stats.getSnapshotTrappedDirs());
assertEquals(1L, stats.getPurgeableDirs());
assertEquals(0L, stats.getPurgeableKeyBytes());

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.

can you please add a test when older OM replies with empty new fields

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Added test case for this.

@sadanand48 sadanand48 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 @priyeshkaratha for the patch, LGTM

@priyeshkaratha
priyeshkaratha marked this pull request as ready for review October 29, 2026 04:17
@priyeshkaratha
priyeshkaratha merged commit 2b85f4a into apache:master Oct 29, 2026
248 of 249 checks passed
@priyeshkaratha

Copy link
Copy Markdown
Member Author

Thanks @sadanand48 for the review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants