You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by "bernardodemarco (via GitHub)" <gi...@apache.org> on 2026/08/03 15:02:37 UTC
[PR] Fix bucket usage retrieval workflow for Ceph RGW [cloudstack]
bernardodemarco opened a new pull request, #13776:
URL: https://github.com/apache/cloudstack/pull/13776
### Description
Each Management Server node runs a background task every hour to fetch bucket usage information for each Object Storage provider registered in the ACS environment. To retrieve the statistics for Ceph RGW, the workflow triggers the `listBucketInfo()` S3 client method, which is equivalent to the `radosgw-admin bucket stats --bucket=<bucket-name>` command.
The size of each bucket is obtained from the `size_kb` field contained in the `usage` JSON object. However, the workflow does not handle the case where the `usage` object is empty, which primarily occurs for empty S3 buckets. The response schema for an empty bucket is shown below:
<details>
<summary><code>radosgw-admin bucket stats</code> response schema for an empty bucket</summary>
```json
{
"bucket": "empty-bucket-outside-acs",
"tenant": "",
"versioning": "off",
"zonegroup": "13e2e428-c665-4fba-9a40-79c966da029c",
"placement_rule": "default-placement",
"explicit_placement": {
"data_pool": "",
"data_extra_pool": "",
"index_pool": ""
},
"id": "d25c72a0-a1f0-4033-a954-53bdff513512.54133.5",
"marker": "d25c72a0-a1f0-4033-a954-53bdff513512.54133.5",
"index_type": "Normal",
"index_generation": 0,
"num_shards": 11,
"object_lock_enabled": false,
"mfa_enabled": false,
"owner": "admin-s3-user",
"ver": "0#1,1#1,2#1,3#1,4#1,5#1,6#1,7#1,8#1,9#1,10#1",
"master_ver": "0#0,1#0,2#0,3#0,4#0,5#0,6#0,7#0,8#0,9#0,10#0",
"mtime": "2026-08-03T13:43:38.160905Z",
"creation_time": "2026-08-03T13:43:38.152185Z",
"max_marker": "0#,1#,2#,3#,4#,5#,6#,7#,8#,9#,10#",
"usage": {},
"bucket_quota": {
"enabled": false,
"check_on_raw": false,
"max_size": -1,
"max_size_kb": 0,
"max_objects": -1
}
}
```
</details>
And, the response schema for a non-empty bucket is shown below:
<details>
<summary><code>radosgw-admin bucket stats</code> response schema for a non-empty bucket</summary>
```json
{
"bucket": "screenshots",
"tenant": "",
"versioning": "off",
"zonegroup": "13e2e428-c665-4fba-9a40-79c966da029c",
"placement_rule": "default-placement",
"explicit_placement": {
"data_pool": "",
"data_extra_pool": "",
"index_pool": ""
},
"id": "d25c72a0-a1f0-4033-a954-53bdff513512.54133.4",
"marker": "d25c72a0-a1f0-4033-a954-53bdff513512.54133.4",
"index_type": "Normal",
"index_generation": 0,
"num_shards": 11,
"object_lock_enabled": false,
"mfa_enabled": false,
"owner": "3af0d458-ecbd-11f0-8ad4-0e2ebc784cf3",
"ver": "0#3,1#3,2#1,3#4,4#1,5#2,6#4,7#3,8#9,9#3,10#2",
"master_ver": "0#0,1#0,2#0,3#0,4#0,5#0,6#0,7#0,8#0,9#0,10#0",
"mtime": "2026-08-03T13:41:32.888630Z",
"creation_time": "2026-08-03T13:41:21.864423Z",
"max_marker": "0#,1#,2#,3#,4#,5#,6#,7#,8#,9#,10#",
"usage": {
"rgw.main": {
"size": 35420402,
"size_actual": 35459072,
"size_utilized": 35420402,
"size_kb": 34591,
"size_kb_actual": 34628,
"size_kb_utilized": 34591,
"num_objects": 24
}
},
"bucket_quota": {
"enabled": true,
"check_on_raw": false,
"max_size": 10737418240,
"max_size_kb": 10485760,
"max_objects": -1
}
}
```
</details>
As a consequence, if there are any empty buckets in the Ceph RGW provider, regardless of whether they are managed by ACS or not, the following NPE is thrown and the entire bucket usage retrieval workflow is aborted. As a result, the size of all buckets is reported as zero.
<details>
<summary>NPE that causes the whole buckets usage retrieval workflow to be aborted</summary>
```
2026-08-03 13:09:57,577 ERROR [o.a.c.s.o.B.BucketUsageTask] (Bucket-Usage-1:[ctx-72301d37]) (logid:0e547d8a) Failed to get bucket usage for Object Store "rgw". Skipping this store. com.cloud.utils.exception.CloudRuntimeException: Cannot invoke "org.twonote.rgwadmin4j.model.BucketInfo$Usage$RgwMain.getSize_kb()" because the return value of "org.twonote.rgwadmin4j.model.BucketInfo$Usage.getRgwMain()" is null
at org.apache.cloudstack.storage.datastore.driver.CephObjectStoreDriverImpl.getAllBucketsUsage(CephObjectStoreDriverImpl.java:313)
at org.apache.cloudstack.storage.object.store.ObjectStoreImpl.getAllBucketsUsage(ObjectStoreImpl.java:155)
at org.apache.cloudstack.storage.object.BucketApiServiceImpl$BucketUsageTask.runInContext(BucketApiServiceImpl.java:325)
at org.apache.cloudstack.managed.context.ManagedContextRunnable$1.run(ManagedContextRunnable.java:49)
at org.apache.cloudstack.managed.context.impl.DefaultManagedContext$1.call(DefaultManagedContext.java:56)
at org.apache.cloudstack.managed.context.impl.DefaultManagedContext.callWithContext(DefaultManagedContext.java:103)
at org.apache.cloudstack.managed.context.impl.DefaultManagedContext.runWithContext(DefaultManagedContext.java:53)
at org.apache.cloudstack.managed.context.ManagedContextRunnable.run(ManagedContextRunnable.java:46)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
at java.base/java.util.concurrent.FutureTask.runAndReset(FutureTask.java:305)
```
</details>
Therefore, this PR fixes this issue by skipping the retrieval of bucket size information when the `usage` JSON object is empty.
---
Fixes #13224
### Types of changes
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
- [ ] New feature (non-breaking change which adds functionality)
- [X] Bug fix (non-breaking change which fixes an issue)
- [ ] Enhancement (improves an existing feature and functionality)
- [ ] Cleanup (Code refactoring and cleanup, that may add test cases)
- [ ] Build/CI
- [ ] Test (unit or integration test code)
### Feature/Enhancement Scale or Bug Severity
#### Bug Severity
- [ ] BLOCKER
- [ ] Critical
- [ ] Major
- [X] Minor
- [ ] Trivial
### Screenshots (if appropriate):
### How Has This Been Tested?
- Registered a Ceph RGW provider;
- Created two buckets through ACS;
- Uploaded some objects to these buckets;
- Created empty buckets not managed by ACS;
- Created an empty bucket through ACS;
- Verified the logs of the bucket usage retrieval workflow;
<details>
<summary>Logs</summary>
```
root@acs:~# grep 'logid:231b7399' /var/log/cloudstack/management/management-server.log
2026-08-03 14:39:13,690 DEBUG [o.a.c.s.o.B.BucketUsageTask] (Bucket-Usage-1:[ctx-e0eeb37f]) (logid:231b7399) Getting bucket usage for Object Store "rgw"
2026-08-03 14:39:13,775 DEBUG [o.a.c.s.d.d.CephObjectStoreDriverImpl] (Bucket-Usage-1:[ctx-e0eeb37f]) (logid:231b7399) Fetching statistics for all buckets accessible by the RGW administrator of the provider with ID [1].
2026-08-03 14:39:13,828 DEBUG [o.a.c.s.d.d.CephObjectStoreDriverImpl] (Bucket-Usage-1:[ctx-e0eeb37f]) (logid:231b7399) Skipping bucket [test] because RGW usage information is unavailable.
2026-08-03 14:39:13,828 DEBUG [o.a.c.s.d.d.CephObjectStoreDriverImpl] (Bucket-Usage-1:[ctx-e0eeb37f]) (logid:231b7399) Skipping bucket [empty-bucket-managed-by-acs] because RGW usage information is unavailable.
2026-08-03 14:39:13,828 DEBUG [o.a.c.s.d.d.CephObjectStoreDriverImpl] (Bucket-Usage-1:[ctx-e0eeb37f]) (logid:231b7399) Skipping bucket [empty-bucket-outside-acs] because RGW usage information is unavailable.
2026-08-03 14:39:13,837 DEBUG [o.a.c.s.o.B.BucketUsageTask] (Bucket-Usage-1:[ctx-e0eeb37f]) (logid:231b7399) Completed updating bucket usage for all object stores
```
</details>
- Verified the return of the `listBuckets` API:
<details>
<summary><code>listBuckets</code> API execution</summary>
```
(admin) 🐱 > list buckets filter=size,name,
{
"bucket": [
{
"name": "rgw-admin-bucket",
"size": 24318
},
{
"name": "screenshots",
"size": 34591
},
{
"name": "empty-bucket-managed-by-acs",
"size": 0
}
],
"count": 3
}
```
</details>
--
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: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Fix bucket usage retrieval workflow for Ceph RGW [cloudstack]
Posted by "Damans227 (via GitHub)" <gi...@apache.org>.
Damans227 commented on code in PR #13776:
URL: https://github.com/apache/cloudstack/pull/13776#discussion_r4230993648
##########
plugins/storage/object/ceph/src/main/java/org/apache/cloudstack/storage/datastore/driver/CephObjectStoreDriverImpl.java:
##########
@@ -302,13 +302,20 @@ public void setBucketQuota(BucketTO bucket, long storeId, long size) {
public Map<String, Long> getAllBucketsUsage(long storeId) {
RgwAdmin rgwAdmin = getRgwAdminClient(storeId);
try {
- List<BucketInfo> bucketinfo = rgwAdmin.listBucketInfo();
- Map<String, Long> bucketsusage = new HashMap<String, Long>();
- for (BucketInfo bucket: bucketinfo) {
+ logger.debug("Fetching statistics for all buckets accessible by the RGW administrator of the provider with ID [{}].", storeId);
+ List<BucketInfo> bucketsInfo = rgwAdmin.listBucketInfo();
+ Map<String, Long> bucketsUsage = new HashMap<>();
+ for (BucketInfo bucket : bucketsInfo) {
BucketInfo.Usage usage = bucket.getUsage();
- bucketsusage.put(bucket.getBucket(), usage.getRgwMain().getSize_kb());
+ if (usage == null || usage.getRgwMain() == null) {
+ logger.debug("Skipping bucket [{}] because RGW usage information is unavailable.", bucket.getBucket());
+ continue;
+ }
+
+ bucketsUsage.put(bucket.getBucket(), usage.getRgwMain().getSize_kb());
Review Comment:
@bernardodemarco yes, it expects bytes. minio already saves bytes and the hourly task adds them up as bytes, so turning the kilobytes into bytes here should fix the list page
--
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: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Fix bucket usage retrieval workflow for Ceph RGW [cloudstack]
Posted by "bernardodemarco (via GitHub)" <gi...@apache.org>.
bernardodemarco commented on code in PR #13776:
URL: https://github.com/apache/cloudstack/pull/13776#discussion_r4231007809
##########
plugins/storage/object/ceph/src/main/java/org/apache/cloudstack/storage/datastore/driver/CephObjectStoreDriverImpl.java:
##########
@@ -302,13 +302,20 @@ public void setBucketQuota(BucketTO bucket, long storeId, long size) {
public Map<String, Long> getAllBucketsUsage(long storeId) {
RgwAdmin rgwAdmin = getRgwAdminClient(storeId);
try {
- List<BucketInfo> bucketinfo = rgwAdmin.listBucketInfo();
- Map<String, Long> bucketsusage = new HashMap<String, Long>();
- for (BucketInfo bucket: bucketinfo) {
+ logger.debug("Fetching statistics for all buckets accessible by the RGW administrator of the provider with ID [{}].", storeId);
+ List<BucketInfo> bucketsInfo = rgwAdmin.listBucketInfo();
+ Map<String, Long> bucketsUsage = new HashMap<>();
+ for (BucketInfo bucket : bucketsInfo) {
BucketInfo.Usage usage = bucket.getUsage();
- bucketsusage.put(bucket.getBucket(), usage.getRgwMain().getSize_kb());
+ if (usage == null || usage.getRgwMain() == null) {
+ logger.debug("Skipping bucket [{}] because RGW usage information is unavailable.", bucket.getBucket());
+ continue;
+ }
+
+ bucketsUsage.put(bucket.getBucket(), usage.getRgwMain().getSize_kb());
Review Comment:
@StepBee @Damans227 I pushed commit https://github.com/apache/cloudstack/pull/13776/commits/e58cdedd08877614718bc09555e22f89dbb917c7 to store bucket sizes in bytes, instead of kilobytes. I appreciate if you guys could test it!
--
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: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Fix bucket usage retrieval workflow for Ceph RGW [cloudstack]
Posted by "bernardodemarco (via GitHub)" <gi...@apache.org>.
bernardodemarco commented on PR #13776:
URL: https://github.com/apache/cloudstack/pull/13776#issuecomment-6081450849
Hello, @StepBee
Thanks for testing!!!
> Surprisingly the size stays 0.00 GiB at the Bucket overview page
This is probably happening because the bucket sizes are too small and the UI rounds them down to 0. To verify that the fix is working correctly, you could check the logs or execute the `listBuckets` API command via CloudMonkey (see PR description for examples).
--
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: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Fix bucket usage retrieval workflow for Ceph RGW [cloudstack]
Posted by "StepBee (via GitHub)" <gi...@apache.org>.
StepBee commented on code in PR #13776:
URL: https://github.com/apache/cloudstack/pull/13776#discussion_r4231628347
##########
plugins/storage/object/ceph/src/main/java/org/apache/cloudstack/storage/datastore/driver/CephObjectStoreDriverImpl.java:
##########
@@ -302,13 +302,20 @@ public void setBucketQuota(BucketTO bucket, long storeId, long size) {
public Map<String, Long> getAllBucketsUsage(long storeId) {
RgwAdmin rgwAdmin = getRgwAdminClient(storeId);
try {
- List<BucketInfo> bucketinfo = rgwAdmin.listBucketInfo();
- Map<String, Long> bucketsusage = new HashMap<String, Long>();
- for (BucketInfo bucket: bucketinfo) {
+ logger.debug("Fetching statistics for all buckets accessible by the RGW administrator of the provider with ID [{}].", storeId);
+ List<BucketInfo> bucketsInfo = rgwAdmin.listBucketInfo();
+ Map<String, Long> bucketsUsage = new HashMap<>();
+ for (BucketInfo bucket : bucketsInfo) {
BucketInfo.Usage usage = bucket.getUsage();
- bucketsusage.put(bucket.getBucket(), usage.getRgwMain().getSize_kb());
+ if (usage == null || usage.getRgwMain() == null) {
+ logger.debug("Skipping bucket [{}] because RGW usage information is unavailable.", bucket.getBucket());
+ continue;
+ }
+
+ bucketsUsage.put(bucket.getBucket(), usage.getRgwMain().getSize_kb());
Review Comment:
@bernardodemarco your change to save in bytes works like a charm now.
Tested successfully.
Thanks for your efforts on this fix!
--
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: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Fix bucket usage retrieval workflow for Ceph RGW [cloudstack]
Posted by "StepBee (via GitHub)" <gi...@apache.org>.
StepBee commented on code in PR #13776:
URL: https://github.com/apache/cloudstack/pull/13776#discussion_r4230866345
##########
plugins/storage/object/ceph/src/main/java/org/apache/cloudstack/storage/datastore/driver/CephObjectStoreDriverImpl.java:
##########
@@ -302,13 +302,20 @@ public void setBucketQuota(BucketTO bucket, long storeId, long size) {
public Map<String, Long> getAllBucketsUsage(long storeId) {
RgwAdmin rgwAdmin = getRgwAdminClient(storeId);
try {
- List<BucketInfo> bucketinfo = rgwAdmin.listBucketInfo();
- Map<String, Long> bucketsusage = new HashMap<String, Long>();
- for (BucketInfo bucket: bucketinfo) {
+ logger.debug("Fetching statistics for all buckets accessible by the RGW administrator of the provider with ID [{}].", storeId);
+ List<BucketInfo> bucketsInfo = rgwAdmin.listBucketInfo();
+ Map<String, Long> bucketsUsage = new HashMap<>();
+ for (BucketInfo bucket : bucketsInfo) {
BucketInfo.Usage usage = bucket.getUsage();
- bucketsusage.put(bucket.getBucket(), usage.getRgwMain().getSize_kb());
+ if (usage == null || usage.getRgwMain() == null) {
+ logger.debug("Skipping bucket [{}] because RGW usage information is unavailable.", bucket.getBucket());
+ continue;
+ }
+
+ bucketsUsage.put(bucket.getBucket(), usage.getRgwMain().getSize_kb());
Review Comment:
@bernardodemarco i uploaded around 3 GB to be sure.
The logs show the debug log of your fix - so the fix is applied correctly:
2026-10-09 12:03:41,697 DEBUG [o.a.c.s.d.d.CephObjectStoreDriverImpl] (Bucket-Usage-1:[ctx-8842af26]) (logid:b3759390) "Skipping bucket [emtpybucket] because RGW usage information is unavailable."
looking at @Damans227 comment, that would make sense - unfortunately, at the moment i can't upload 1024 GB for testing to check your finding - but i could try to change the fix code and multiply
usage.getRgwMain().getSize_kb() * 1024
to save bytes instead if kbytes and re-check.
--
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: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Fix bucket usage retrieval workflow for Ceph RGW [cloudstack]
Posted by "Damans227 (via GitHub)" <gi...@apache.org>.
Damans227 commented on code in PR #13776:
URL: https://github.com/apache/cloudstack/pull/13776#discussion_r4231736926
##########
plugins/storage/object/ceph/src/main/java/org/apache/cloudstack/storage/datastore/driver/CephObjectStoreDriverImpl.java:
##########
@@ -302,13 +302,20 @@ public void setBucketQuota(BucketTO bucket, long storeId, long size) {
public Map<String, Long> getAllBucketsUsage(long storeId) {
RgwAdmin rgwAdmin = getRgwAdminClient(storeId);
try {
- List<BucketInfo> bucketinfo = rgwAdmin.listBucketInfo();
- Map<String, Long> bucketsusage = new HashMap<String, Long>();
- for (BucketInfo bucket: bucketinfo) {
+ logger.debug("Fetching statistics for all buckets accessible by the RGW administrator of the provider with ID [{}].", storeId);
+ List<BucketInfo> bucketsInfo = rgwAdmin.listBucketInfo();
+ Map<String, Long> bucketsUsage = new HashMap<>();
+ for (BucketInfo bucket : bucketsInfo) {
BucketInfo.Usage usage = bucket.getUsage();
- bucketsusage.put(bucket.getBucket(), usage.getRgwMain().getSize_kb());
+ if (usage == null || usage.getRgwMain() == null) {
+ logger.debug("Skipping bucket [{}] because RGW usage information is unavailable.", bucket.getBucket());
+ continue;
+ }
+
+ bucketsUsage.put(bucket.getBucket(), usage.getRgwMain().getSize_kb());
Review Comment:
thanks @bernardodemarco, that covers it
--
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: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Fix bucket usage retrieval workflow for Ceph RGW [cloudstack]
Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #13776:
URL: https://github.com/apache/cloudstack/pull/13776#issuecomment-6084600828
@bernardodemarco a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.
--
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: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Fix bucket usage retrieval workflow for Ceph RGW [cloudstack]
Posted by "bernardodemarco (via GitHub)" <gi...@apache.org>.
bernardodemarco commented on PR #13776:
URL: https://github.com/apache/cloudstack/pull/13776#issuecomment-6275474876
@DaanHoogland, can we run the CI here? If it passes, it would be ready to go
--
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: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Fix bucket usage retrieval workflow for Ceph RGW [cloudstack]
Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #13776:
URL: https://github.com/apache/cloudstack/pull/13776#issuecomment-5168446204
## [Codecov](https://app.codecov.io/gh/apache/cloudstack/pull/13776?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
:white_check_mark: All modified and coverable lines are covered by tests.
:white_check_mark: Project coverage is 3.69%. Comparing base ([`5328528`](https://app.codecov.io/gh/apache/cloudstack/commit/532852824a9729ff9f073e3678d9d0bd8afeb059?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`dcfa614`](https://app.codecov.io/gh/apache/cloudstack/commit/dcfa6145c4480aa11983ab41797ca89a0d1578fa?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
> :exclamation: There is a different number of reports uploaded between BASE (5328528) and HEAD (dcfa614). Click for more details.
>
> <details><summary>HEAD has 1 upload less than BASE</summary>
>
>| Flag | BASE (5328528) | HEAD (dcfa614) |
>|------|------|------|
>|unittests|1|0|
></details>
<details><summary>Additional details and impacted files</summary>
```diff
@@ Coverage Diff @@
## 4.22 #13776 +/- ##
=============================================
- Coverage 17.69% 3.69% -14.01%
=============================================
Files 5925 449 -5476
Lines 533539 38176 -495363
Branches 65274 7072 -58202
=============================================
- Hits 94427 1409 -93018
+ Misses 428435 36580 -391855
+ Partials 10677 187 -10490
```
| [Flag](https://app.codecov.io/gh/apache/cloudstack/pull/13776/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
|---|---|---|
| [uitests](https://app.codecov.io/gh/apache/cloudstack/pull/13776/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `3.69% <ø> (ø)` | |
| [unittests](https://app.codecov.io/gh/apache/cloudstack/pull/13776/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#carryforward-flags-in-the-pull-request-comment) to find out more.
</details>
[:umbrella: View full report in Codecov by Harness](https://app.codecov.io/gh/apache/cloudstack/pull/13776?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
:loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
<details><summary> :rocket: New features to boost your workflow: </summary>
- :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
- :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
</details>
--
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: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Fix bucket usage retrieval workflow for Ceph RGW [cloudstack]
Posted by "bernardodemarco (via GitHub)" <gi...@apache.org>.
bernardodemarco commented on PR #13776:
URL: https://github.com/apache/cloudstack/pull/13776#issuecomment-6084591962
@blueorangutan package
--
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: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Fix bucket usage retrieval workflow for Ceph RGW [cloudstack]
Posted by "bernardodemarco (via GitHub)" <gi...@apache.org>.
bernardodemarco commented on PR #13776:
URL: https://github.com/apache/cloudstack/pull/13776#issuecomment-6084586528
Ok, great news! Thanks guys @StepBee @Damans227
--
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: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Fix bucket usage retrieval workflow for Ceph RGW [cloudstack]
Posted by "StepBee (via GitHub)" <gi...@apache.org>.
StepBee commented on code in PR #13776:
URL: https://github.com/apache/cloudstack/pull/13776#discussion_r4230866345
##########
plugins/storage/object/ceph/src/main/java/org/apache/cloudstack/storage/datastore/driver/CephObjectStoreDriverImpl.java:
##########
@@ -302,13 +302,20 @@ public void setBucketQuota(BucketTO bucket, long storeId, long size) {
public Map<String, Long> getAllBucketsUsage(long storeId) {
RgwAdmin rgwAdmin = getRgwAdminClient(storeId);
try {
- List<BucketInfo> bucketinfo = rgwAdmin.listBucketInfo();
- Map<String, Long> bucketsusage = new HashMap<String, Long>();
- for (BucketInfo bucket: bucketinfo) {
+ logger.debug("Fetching statistics for all buckets accessible by the RGW administrator of the provider with ID [{}].", storeId);
+ List<BucketInfo> bucketsInfo = rgwAdmin.listBucketInfo();
+ Map<String, Long> bucketsUsage = new HashMap<>();
+ for (BucketInfo bucket : bucketsInfo) {
BucketInfo.Usage usage = bucket.getUsage();
- bucketsusage.put(bucket.getBucket(), usage.getRgwMain().getSize_kb());
+ if (usage == null || usage.getRgwMain() == null) {
+ logger.debug("Skipping bucket [{}] because RGW usage information is unavailable.", bucket.getBucket());
+ continue;
+ }
+
+ bucketsUsage.put(bucket.getBucket(), usage.getRgwMain().getSize_kb());
Review Comment:
@bernardodemarco i uploaded around 3 GB to be sure.
The logs show the debug log of your fix - so the fix is applied correctly:
2026-10-09 12:03:41,697 DEBUG [o.a.c.s.d.d.CephObjectStoreDriverImpl] (Bucket-Usage-1:[ctx-8842af26]) (logid:b3759390) "Skipping bucket [emtpybucket] because RGW usage information is unavailable."
looking at @Damans227 comment, that would make sense - unfortunately, at the moment i can't upload 1024 GB for testing to check your finding - but i could try to change the fix code and multiply
usage.getRgwMain().getSize_kb() * 1024
to save bytes instead if kbytes and re-check.
I checked as well the number on the bucket detail page - it's showing in kbyte indeed.
--
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: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Fix bucket usage retrieval workflow for Ceph RGW [cloudstack]
Posted by "StepBee (via GitHub)" <gi...@apache.org>.
StepBee commented on PR #13776:
URL: https://github.com/apache/cloudstack/pull/13776#issuecomment-6081200367
Hi @bernardodemarco thanks for taking the effort for this fix, much appreciated.
I tested the fix in my environment (which has exactly the issue you described), CS 4.22.1.1 and can confirm 50% success of your fix.
The size is correctly displayed when i clicked the bucket, for example
Storage / Buckets / mydemobucket01
resulting in the url
https://poc.my.cloud/client/#/buckets/94d91b68-ac30-4317-97f8-3b68f5407ce1
The page with all bucket information including Access Key and Secret Key is displaying the correct number in "Size".
Surprisingly the size stays 0.00 GiB at the Bucket overview page
Storage / Buckets
resulting in the url
https://poc.my.cloud/client/#/buckets
Next to "Name", "State" etc, the value of "Size" stays 0.00 GiB
Is this just my environment or do you see the same?
--
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: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Fix bucket usage retrieval workflow for Ceph RGW [cloudstack]
Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #13776:
URL: https://github.com/apache/cloudstack/pull/13776#issuecomment-6275856245
@DaanHoogland a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests
--
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: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Fix bucket usage retrieval workflow for Ceph RGW [cloudstack]
Posted by "bernardodemarco (via GitHub)" <gi...@apache.org>.
bernardodemarco commented on code in PR #13776:
URL: https://github.com/apache/cloudstack/pull/13776#discussion_r4230750086
##########
plugins/storage/object/ceph/src/main/java/org/apache/cloudstack/storage/datastore/driver/CephObjectStoreDriverImpl.java:
##########
@@ -302,13 +302,20 @@ public void setBucketQuota(BucketTO bucket, long storeId, long size) {
public Map<String, Long> getAllBucketsUsage(long storeId) {
RgwAdmin rgwAdmin = getRgwAdminClient(storeId);
try {
- List<BucketInfo> bucketinfo = rgwAdmin.listBucketInfo();
- Map<String, Long> bucketsusage = new HashMap<String, Long>();
- for (BucketInfo bucket: bucketinfo) {
+ logger.debug("Fetching statistics for all buckets accessible by the RGW administrator of the provider with ID [{}].", storeId);
+ List<BucketInfo> bucketsInfo = rgwAdmin.listBucketInfo();
+ Map<String, Long> bucketsUsage = new HashMap<>();
+ for (BucketInfo bucket : bucketsInfo) {
BucketInfo.Usage usage = bucket.getUsage();
- bucketsusage.put(bucket.getBucket(), usage.getRgwMain().getSize_kb());
+ if (usage == null || usage.getRgwMain() == null) {
+ logger.debug("Skipping bucket [{}] because RGW usage information is unavailable.", bucket.getBucket());
+ continue;
+ }
+
+ bucketsUsage.put(bucket.getBucket(), usage.getRgwMain().getSize_kb());
Review Comment:
Hello, @Damans227
> does this save kilobytes where the rest expects bytes?
Yes, it is saving in kilobytes; the current PR does not change the unit of measurement of bucket sizes.
If the UI actually expects these values to be in bytes, I can change and fix it, though. Please, let me know
--
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: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Fix bucket usage retrieval workflow for Ceph RGW [cloudstack]
Posted by "Damans227 (via GitHub)" <gi...@apache.org>.
Damans227 commented on code in PR #13776:
URL: https://github.com/apache/cloudstack/pull/13776#discussion_r4230534576
##########
plugins/storage/object/ceph/src/main/java/org/apache/cloudstack/storage/datastore/driver/CephObjectStoreDriverImpl.java:
##########
@@ -302,13 +302,20 @@ public void setBucketQuota(BucketTO bucket, long storeId, long size) {
public Map<String, Long> getAllBucketsUsage(long storeId) {
RgwAdmin rgwAdmin = getRgwAdminClient(storeId);
try {
- List<BucketInfo> bucketinfo = rgwAdmin.listBucketInfo();
- Map<String, Long> bucketsusage = new HashMap<String, Long>();
- for (BucketInfo bucket: bucketinfo) {
+ logger.debug("Fetching statistics for all buckets accessible by the RGW administrator of the provider with ID [{}].", storeId);
+ List<BucketInfo> bucketsInfo = rgwAdmin.listBucketInfo();
+ Map<String, Long> bucketsUsage = new HashMap<>();
+ for (BucketInfo bucket : bucketsInfo) {
BucketInfo.Usage usage = bucket.getUsage();
- bucketsusage.put(bucket.getBucket(), usage.getRgwMain().getSize_kb());
+ if (usage == null || usage.getRgwMain() == null) {
+ logger.debug("Skipping bucket [{}] because RGW usage information is unavailable.", bucket.getBucket());
+ continue;
+ }
+
+ bucketsUsage.put(bucket.getBucket(), usage.getRgwMain().getSize_kb());
Review Comment:
does this save kilobytes where the rest expects bytes? the list page divides by 1024 three times, so a 1.4 gb bucket shows as 0.00 GiB like StepBee saw
--
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: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Fix bucket usage retrieval workflow for Ceph RGW [cloudstack]
Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #13776:
URL: https://github.com/apache/cloudstack/pull/13776#issuecomment-6085535570
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 19502
--
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: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Fix bucket usage retrieval workflow for Ceph RGW [cloudstack]
Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #13776:
URL: https://github.com/apache/cloudstack/pull/13776#issuecomment-6290944015
<b>[SF] Trillian test result (tid-17161)</b>
Environment: kvm-ol8 (x2), zone: Advanced Networking with Mgmt server ol8
Total time taken: 56886 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr13776-t17161-kvm-ol8.zip
Smoke tests completed. 149 look OK, 0 have errors, 0 did not run
Only failed and skipped tests results shown below:
Test | Result | Time (s) | Test File
--- | --- | --- | ---
--
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: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Fix bucket usage retrieval workflow for Ceph RGW [cloudstack]
Posted by "DaanHoogland (via GitHub)" <gi...@apache.org>.
DaanHoogland commented on PR #13776:
URL: https://github.com/apache/cloudstack/pull/13776#issuecomment-6275837049
@blueorangutan test
--
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: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org