False positive in UsageSanityChecker
- 主要语言
- 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