Files
Pulse/internal/api/resourceapi
rcourtman 2ef20aa53e Read PBS snapshot ownership from one rule in Patrol and rollups
When two Proxmox connections reuse VMIDs and guest names, Patrol and the
PBS rollups each decided for themselves which guest owned a snapshot, so
they disagreed with the guest badge and the Backups table.

On a colliding estate a failing datastore's row said "Puts backups for 3
protected workloads" where the rule and the badges name 7, and a host
backup counted as the VM with its ID. A Patrol run scoped to a guest
whose last backup was 10 days old called it recent, using the backup of
another connection's guest with the same VMID. Two guests with one name
merged, which hid the stale one.

Both now read models.AttributePBSBackups. A StateSnapshot holds the PVE
storage evidence State holds, so it gives the same answer, and Patrol
takes that answer before a scope narrows the guests. A snapshot the rule
leaves unsettled counts for nobody. Patrol also stops crediting partial
archives, incomplete snapshots and archives of the other guest kind,
which the badge never counted.

A registry seeded from resources, which is how /api/resources reads a
running monitor, has no backups to count and zeroed every PBS rollup, so
REST disagreed with websocket rows. It now keeps what its seed carries.
After an operator links two guests, REST shows the old rollup until the
monitor's next publication.

Attribution now runs on every snapshot ingest, so estates without a
collision skip the source learner and the registry stops copying snapshot
rows. At 1000 guests and 50k snapshots ingest stays near 41 ms with fewer
allocations. If every VMID collides it costs about 120 ms more, the same
work SyncGuestBackupTimes already does there.

Refs #2681
2026-11-04 18:33:45 +00:00
..
2026-10-11 22:20:25 +01:00