Skip to content

HDDS-17239. Initialize usage counters on bucket create - #11742

Open
rjgoyln wants to merge 3 commits into
apache:masterfrom
rjgoyln:HDDS-17239
Open

rjgoyln wants to merge 3 commits into
apache:masterfrom
rjgoyln:HDDS-17239

Conversation

@rjgoyln

@rjgoyln rjgoyln commented Oct 24, 2026

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

OM maintains a bucket's usedBytes, usedNamespace and snapshot usage counters, but bucket create stored whatever the request carried. The Ozone client, ozone sh and S3 Gateway send 0; any other client can create a bucket with usage it does not have, which stays until a quota repair. For example:

  • an empty bucket rejects its first directory with QUOTA_EXCEEDED when created with usedNamespace at quotaInNamespace;
  • ozone sh bucket info reports the injected usage.

Clearing the counters in preExecute puts 0 into the Ratis log, so the apply step is unchanged and old and new OMs agree during an upgrade. This is the JIRA patch's fix and the bucket counterpart of HDDS-17238 (#11720).

testLinkedBucketResolution seeded its source bucket's usage through bucket create, so it now writes that bucket to the table directly.

What is the link to the Apache JIRA?

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

How was this patch tested?

  • The new TestOMBucketCreateRequest case fails on master.
  • Bucket request/response suites and TestBucketManagerImpl pass (97 tests).

Generated-by: Claude Code (Opus 5.5)

OM maintains a bucket's usedBytes, usedNamespace and snapshot usage
counters, but bucket create stored whatever the request carried. A
client that sends non-zero values leaves a new bucket with usage that
does not match its content, which later quota checks and bucket info
then report and enforce.
Copilot AI balanced review requested due to automatic review settings October 24, 2026 17:17

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

@github-actions github-actions Bot added the om label Oct 24, 2026

@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 @rjgoyln for the patch.

@rjgoyln
rjgoyln marked this pull request as ready for review October 25, 2026 18:14
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.

3 participants