Bucket usage continues even after the bucket is deleted.
- 主要语言
- Java
- 星标
- 3.1k
- 派生
- 1.4k
- 平均合并
- 6 天 19 小时
- 30 天内合并 PR
- 32
描述
### problem
Good afternoon everyone,
I've identified a potential bug in the CloudStack usage section. After deleting a bucket, I noticed that the `cloudstack.listUsageRecords` API call was still reporting usage of the deleted buckets for the accounts.
I started exploring the code and how this bucket usage system works, and I found that it all depends on the `bucket_statistics` table.
From what I understand and replicate in my tests, when a bucket is removed, the `bucket_statistics` table retains the used size value. In my understanding, the correct approach would be to reset this value or delete the record for that bucket in this table. I corrected this in the accounts by resetting the size value, thus stopping the generation of new records in the `cloud_usage` table.
If you have any further questions, feel free to ask and I'll provide more details.
Thank you.
### versions
Cloudstack 4.22
### The steps to reproduce the bug
1. Create a bucket
2. Add data to the bucket
3. Wait a few days for cloud_usage records to be generated
4. Remove the data from the bucket
5. Then remove the bucket from Cloudstack
6. Verify in the listUsageRecords API calls that usage records are still being generated for the bucket.
### What to do about it?
When removing a bucket, the bucket_statistics table retains the used size value; in my understanding, the correct approach would be to reset this value or delete the record for that bucket in this table.
贡献指南
调研方向
首先跟踪 bucket 删除和 bucket_statistics 记录,然后继续跟踪 cloudstack.listUsageRecords 如何将该保留的大小读入 cloud_usage 记录。在 CloudStack 4.22 上重现所列序列,并验证删除 bucket 后不再为其生成使用记录。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- java
- 领域
- api, cloud, databases
- Issue 类型
- 缺陷
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 活跃度
- 活跃
- 描述清晰度
- 基本清楚
- 新手友好度
- 66/100