apache / apache/cloudstack

Bucket usage continues even after the bucket is deleted.

オープン
#13,057 コメント 7 件 リアクション 0 件 担当者 0 名 GitHub で見る
component:object-storage no-issue-activity
主要言語
Java
スター
3.1k
フォーク
1.4k
平均マージ
6日 19時間
マージ済み PR(30日)
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_statistics レコードを追跡し、次に cloudstack.listUsageRecords がその保持されたサイズを cloud_usage レコードに読み込む流れを追ってください。CloudStack 4.22 で記載されたシーケンスを再現し、バケットを削除するとそのバケットの使用量レコードが生成されなくなっていることを確認してください。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
java
領域
api, cloud, databases
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
活発
明瞭さ
おおむね明確
初心者へのやさしさ
66/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。