GitHub user PPisz added a comment to the discussion: database consitency
@DaanHoogland We can't seem to figure this out. Is it possible to find the
query that generates this alert somewhere in the CS source code? This would
make it easier for us to find and fix invalid records.
`SELECT ce.*
FROM cloud.usage_event ce
JOIN (SELECT resource_id, MAX(created) AS destroy_date
FROM cloud.usage_event
WHERE type = 'VM.DESTROY'
GROUP BY resource_id) AS de ON ce.resource_id = de.resource_id
WHERE ce.created > de.destroy_date AND ce.type LIKE 'VM.%';`
The example query returns nothing, but we're probably doing it wrong.
GitHub link:
https://github.com/apache/cloudstack/discussions/11958#discussioncomment-14868328
----
This is an automatically sent email for [email protected].
To unsubscribe, please send an email to: [email protected]