[data-veracity] Events written under a resource-group code are invisible to every KPI and re-injected every 3 seconds #29
Labels
No labels
blocked
bug
enhancement
high-priority
low-priority
needs-info
needs-triage
ready-for-agent
ready-for-human
referenced
research
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
gabogg/hikcentral#29
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem — two halves that combine into a runaway
Half 1: events can be written with a
camera_index_codethat is not a cameraWhen a resource group exposes no member resources, or when keyword matching empties a direction list, the sync falls back to the group code as though it were a camera:
Rows are then inserted into
people_counting_eventswithcamera_index_code = <resourceGroupIndexCode>, which has no row incounting_cameras.Half 2: every KPI query inner-joins
counting_camerasOrphan rows match nothing, so they are silently dropped from every reported figure.
The combination is a runaway
The sync's own reconciliation reads the per-camera list from
get_timespan_aggregates_async, which is aLEFT JOINfromcounting_cameras:An orphan code has no
counting_camerasrow, so it never appears in that list, so:The entire cumulative Artemis count is re-injected as a new event on every 3-second poll, forever. At 1,200 polls per hour this inflates the events table without bound. The rows are invisible to the KPI queries, so the corruption shows up as unbounded table growth and (once someone registers that code as a camera, or removes the
is_activefilter) an absurd ingress figure.The same trap fires for any camera whose
counting_cameras.is_activeis set to0while it is still a member of a live Artemis group.KPIs corrupted
Directly: none while the orphan stays orphaned — which is the danger, since the loss is invisible. Once the code is registered or a query drops the join, Gross Ingress / Egress and everything downstream inflate by orders of magnitude. Meanwhile real traffic through a group with no mapped resources is never counted at all.
Suggested fix
FLAG_UNMAPPED_GROUPand skip; do not invent a pseudo-camera.counting_camerasas an explicit synthetic portal (camera_index_code = g_code,direction_type = BIDIRECTIONAL) so it is at least visible and operator-editable.SELECT DISTINCT camera_index_code FROM people_counting_events WHERE camera_index_code NOT IN (SELECT camera_index_code FROM counting_cameras)— log loudly if non-empty.relatedResourceInfoListis empty must produce zero events and one warning, not a growing table.gabogg referenced this issue2026-09-22 16:31:07 +00:00