You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by "rjgoyln (via GitHub)" <gi...@apache.org> on 2026/10/23 16:45:22 UTC
[PR] HDDS-17238. Initialize refCount and usedNamespace on volume create [ozone]
rjgoyln opened a new pull request, #11720:
URL: https://github.com/apache/ozone/pull/11720
## What changes were proposed in this pull request?
OM maintains a volume's `refCount` and `usedNamespace`, but volume create stored whatever the request's `VolumeInfo` carried, and nothing recomputes them later. The Ozone client and `ozone sh` send 0, but a request from any other client can leave:
- an empty volume that cannot be deleted (`VOLUME_IS_REFERENCED`), from a non-zero `refCount`;
- an empty volume that rejects its first bucket (`QUOTA_EXCEEDED`), from `usedNamespace` at `quotaInNamespace`.
Clearing both in `preExecute` puts 0 into the Ratis log, so the apply step is unchanged and OMs on old and new versions agree during an upgrade. This is the fix proposed in the JIRA patch.
## What is the link to the Apache JIRA?
https://issues.apache.org/jira/browse/HDDS-17238
## How was this patch tested?
- The new `TestOMVolumeCreateRequest` case fails on master, and again with only `clearRefCount()` applied, so it covers both counters.
- Volume, tenant create/delete and bucket create suites pass (95 tests).
Generated-by: Claude Code (Opus 5.5)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
Re: [PR] HDDS-17238. Initialize refCount and usedNamespace on volume create [ozone]
Posted by "peterxcli (via GitHub)" <gi...@apache.org>.
peterxcli commented on code in PR #11720:
URL: https://github.com/apache/ozone/pull/11720#discussion_r4367785168
##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/volume/OMVolumeCreateRequest.java:
##########
@@ -95,6 +95,9 @@ public OMRequest preExecute(OzoneManager ozoneManager) throws IOException {
volumeInfo.toBuilder()
.setCreationTime(initialTime)
.setModificationTime(initialTime)
+ // usedNamespace and refCount are maintained by OM, so a new volume starts with both at 0.
Review Comment:
```suggestion
// reset usedNamespace and refCount to 0 to prevent arbitrary value set in the request from any other client
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
Re: [PR] HDDS-17238. Initialize refCount and usedNamespace on volume create [ozone]
Posted by "adoroszlai (via GitHub)" <gi...@apache.org>.
adoroszlai merged PR #11720:
URL: https://github.com/apache/ozone/pull/11720
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
Re: [PR] HDDS-17238. Initialize refCount and usedNamespace on volume create [ozone]
Posted by "adoroszlai (via GitHub)" <gi...@apache.org>.
adoroszlai commented on PR #11720:
URL: https://github.com/apache/ozone/pull/11720#issuecomment-6389821747
Thanks @rjgoyln for the patch, @peterxcli, @smengcl for the review.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
Re: [PR] HDDS-17238. Initialize refCount and usedNamespace on volume create [ozone]
Posted by "rjgoyln (via GitHub)" <gi...@apache.org>.
rjgoyln commented on PR #11720:
URL: https://github.com/apache/ozone/pull/11720#issuecomment-6386832143
Thanks for the @smengcl review!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
Re: [PR] HDDS-17238. Initialize refCount and usedNamespace on volume create [ozone]
Posted by "peterxcli (via GitHub)" <gi...@apache.org>.
peterxcli commented on code in PR #11720:
URL: https://github.com/apache/ozone/pull/11720#discussion_r4367785168
##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/volume/OMVolumeCreateRequest.java:
##########
@@ -95,6 +95,9 @@ public OMRequest preExecute(OzoneManager ozoneManager) throws IOException {
volumeInfo.toBuilder()
.setCreationTime(initialTime)
.setModificationTime(initialTime)
+ // usedNamespace and refCount are maintained by OM, so a new volume starts with both at 0.
Review Comment:
```suggestion
// reset usedNamespace and refCount to 0 to prevent arbitrary values set in the request by any other client
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org