HDDS-14467. Expose pending delete bytes/namespace in OzoneBucket.#9708
HDDS-14467. Expose pending delete bytes/namespace in OzoneBucket.#9708sadanand48 wants to merge 3 commits intoapache:masterfrom
Conversation
| @@ -1330,6 +1332,8 @@ public List<OzoneBucket> listBuckets(String volumeName, String bucketPrefix, | |||
| .setSourceBucket(bucket.getSourceBucket()) | |||
| .setUsedBytes(bucket.getTotalBucketSpace()) | |||
| .setUsedNamespace(bucket.getTotalBucketNamespace()) | |||
| .setPendingDeleteBytes(bucket.getSnapshotUsedBytes()) | |||
| .setPendingDeleteNamespace(bucket.getSnapshotUsedNamespace()) | |||
There was a problem hiding this comment.
Thanks @sadanand48 for the patch.
Let's document the behavior of PendingDeleteBytes / PendingDeleteNamespace (e.g. not accounting for keys that are not recursed yet).
There was a problem hiding this comment.
created https://issues.apache.org/jira/browse/HDDS-14642 for the same.
|
@jojochuang @smengcl FYI. I think this should be okay as even today the updates to usedBytes and usedNamespace happens in the same way. Exposing snapshotUsedBytes might still be useful when snapshot lifespan is significant, as it helps users understand quota usage and why space is not reclaimed after deletes. |
What changes were proposed in this pull request?
After HDDS-13756, OzoneBucket.usedBytes is populated from OmBucketInfo.getTotalBucketSpace() (used + snapshotUsed bytes), which makes bucket usage ambiguous after key deletion. This change adds explicit pendingDeleteBytes / pendingDeleteNamespace fields to OzoneBucket to clarify retained bytes (snapshots or pending delete).
What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-14467
How was this patch tested?
Unit tests