apache / apache/cloudstack

Bucket usage continues even after the bucket is deleted.

Offen
#13,057 7 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
component:object-storage no-issue-activity
Vorherrschende Sprache
Java
Sterne
3.1k
Forks
1.4k
Ø Merge
6 T. 19 Std.
Gemergte PRs (30 T.)
32

Beschreibung

### 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.

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Beginne damit, das Löschen von Buckets und den Datensatz bucket_statistics nachzuverfolgen, und verfolge dann, wie cloudstack.listUsageRecords diese beibehaltene Größe in cloud_usage-Datensätze einliest. Reproduziere die aufgeführte Sequenz auf CloudStack 4.22 und überprüfe, dass das Löschen eines Buckets dafür keine Nutzungsdatensätze mehr erzeugt.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
java
Bereich
api, cloud, databases
Issue-Typ
Bug
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Aktiv
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
66/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.