GitHub user KuasarCloud added a comment to the discussion: Insert Event 
Manually to force Usage Recalculation

Hi @DaanHoogland,

While checking on the `cloud_usage.usage_event` table for Load Balancer (LB) 
rules, I noticed that the LB events are copied, but the calculation seems to 
continue indefinitely. Below is an example where each LB rule element has its 
own `CREATE`/`DELETE` pair:

```sql
SELECT * FROM cloud_usage.usage_event 
WHERE type LIKE '%LB%' 
AND resource_id IN ('272','271','252','189','185','164');
```
| Type           | Created                            | Resource ID |
|------------|-------------------------|-------------|
| LB.CREATE | 2024-01-19 14:10:55     | 164               |
| LB.DELETE | 2024-01-22 20:58:40    | 164              |
| LB.CREATE | 2024-03-26 23:14:34    | 185              |
| LB.CREATE | 2024-04-03 16:07:47    | 189              |
| LB.DELETE | 2024-05-30 21:45:46    | 189              |
| LB.CREATE | 2024-07-25 20:59:47    | 252             |
| LB.CREATE | 2024-07-26 16:05:00    | 271             |
| LB.CREATE | 2024-07-26 16:13:55     | 272            |
| LB.DELETE | 2024-07-26 16:16:16     | 272             |
| LB.DELETE | 2024-07-26 17:49:17     | 252             |
| LB.DELETE | 2024-07-26 17:49:27     | 271             |
| LB.DELETE | 2024-07-27 18:27:51     | 185             |

---

The above results indicate that there are corresponding `CREATE` and `DELETE` 
events for the same `resource_id`. However, the usage calculation seems to be 
stuck in an indefinite loop.

Could you please provide guidance?

Thank you!


GitHub link: 
https://github.com/apache/cloudstack/discussions/9597#discussioncomment-10487989

----
This is an automatically sent email for [email protected].
To unsubscribe, please send an email to: [email protected]

Reply via email to