False positive in UsageSanityChecker
- Ngôn ngữ chính
- Java
- Star
- 3.1k
- Fork
- 1.4k
- Merge trung bình
- 6 ngày 19 giờ
- Pull request đã merge (30 ngày)
- 32
Mô tả
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_
Hướng dẫn đóng góp
Hướng nghiên cứu
Bắt đầu trong UsageSanityChecker.java bằng cách lần theo kiểm tra “snapshot after removed” và truy vấn SQL của nó đối với cloud_usage.cloud_usage và cloud.snapshots. Điều tra lý do instance 4.22.1.0 đang chạy báo cáo 160 bản ghi, sau đó xác minh rằng vấn đề về số lượng false positive đã được giải quyết mà không làm hỏng mailer Usage Sanity Check hoặc đầu ra của Prometheus exporter.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- java, sql
- Lĩnh vực
- backend, cloud, databases, observability
- Loại issue
- Lỗi
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức độ hoạt động
- Ít trao đổi
- Độ rõ ràng
- Cần làm rõ
- Mức phù hợp với người mới
- 38/100