apache / apache/cloudstack

False positive in UsageSanityChecker

未關閉
#13,446 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
component:usage-server
主要語言
Java
星號
3.1k
分支
1.4k
平均合併
6 天 19 小時
30 天內合併 PR
32

描述

The bug we're hitting is in a different subsystem: the Usage Sanity Check (UsageSanityChecker.java). Specifically the "snapshot after removed" check, whose query is roughly:


SELECT count(*)

FROM cloud_usage.cloud_usage cu
JOIN cloud.snapshots s ON cu.usage_id = s.id
WHERE cu.usage_type = 9
AND cu.start_date > s.removed;

i.e. usage records in cloud_usage.cloud_usage with a start_date AFTER the snapshot was already soft-deleted in cloud.snapshots. This drives the Usage Sanity Check failed mailer and feeds our Prometheus exporter.


On the running 4.22.1.0 (which includes 83ce006) we still see:

check | count
-- | --
snapshot_after_removed | 160
volume_after_removed | 36
template_after_removed | 0
vm_after_destroyed | 0

_Originally posted by @PPisz in https://github.com/apache/cloudstack/discussions/13398#discussioncomment-17321658_

貢獻指南

開啟貢獻指南

研究方向

從 UsageSanityChecker.java 開始,追蹤「snapshot after removed」檢查及其針對 cloud_usage.cloud_usage 和 cloud.snapshots 的 SQL 查詢。調查正在執行的 4.22.1.0 執行個體為何回報 160 筆記錄,然後驗證在不破壞 Usage Sanity Check mailer 或 Prometheus exporter 輸出的情況下,false-positive 計數問題已獲得解決。

由索引模型根據 Issue 內容生成。

評估

技術堆疊
java, sql
領域
backend, cloud, databases, observability
Issue 類型
缺陷
難度
4/5
預估耗時
3-5 天
活躍度
冷清
描述清晰度
需要釐清
新手友好度
38/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。