Bucket usage continues even after the bucket is deleted.
- Ngôn ngữ chính
- Java
- Star
- 3.1k
- Fork
- 1.4k
- Merge trung bình
- 6 ngày 19 giờ
- Pull request đã merge (30 ngày)
- 32
Mô tả
### 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.
Hướng dẫn đóng góp
Hướng nghiên cứu
Bắt đầu bằng cách theo dõi việc xóa bucket và bản ghi bucket_statistics, sau đó theo dõi cách cloudstack.listUsageRecords đọc kích thước được giữ lại đó vào các bản ghi cloud_usage. Tái hiện chuỗi thao tác được liệt kê trên CloudStack 4.22 và xác minh rằng việc xóa một bucket không còn tạo ra các bản ghi sử dụng cho bucket đó.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- java
- Lĩnh vực
- api, cloud, databases
- Loại issue
- Lỗi
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức độ hoạt động
- Sôi nổi
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 66/100