Skip to content

ping_triggers outlive packet retention (1884 of 3682 on staging) — confirm it is intended for ping-score history, document or prune #241

Closed

Description

@dborup

Relates to #215, #222

Observation

The post-migration verification of #222 on staging found ping_triggers rows whose tx_id no longer exists in transmissions. The pre-migration snapshot has the same count, so this does not come from the migration.

Count
ping_triggers total 3682
without a transmission 1884
without a transmission inside the packet retention window 0

The orphaned rows span first_seen 2026-07-14 to 2026-09-05. The oldest remaining transmission is from 2026-09-05. In other words, every orphan is older than the packet retention window.

Cause. PruneOldPackets in cmd/ingestor/maintenance.go deletes observations and route_mask_changes together with an aged transmission, but leaves ping_triggers in place. PruneOrphanRouteMaskChanges exists for route_mask_changes. There is nothing equivalent for ping_triggers.

Question: intentional or a gap?

This may be by design. cmd/server/ping_score_history.go describes the ping-score history store as "the ONLY remaining source for that ping's contribution to the all-time records" once packets are pruned, and the history engine reconciles against ping_triggers. If the all-time ping records rely on ping_triggers outliving the packets, these rows are not orphans in the harmful sense.

Tasks

  • Confirm from the ping-score history code and its tests whether ping_triggers must outlive packet retention. Check what the engine does with a trigger whose transmission is gone (DataPruned, Unscorable).
  • If intentional: document it at PruneOldPackets and in the schema notes. Note it in deploy-verification guidance, so that "orphan ping_triggers" is not reported as an integrity error. Decide whether an upper bound is needed. Today the table grows by roughly 100 rows a day on staging.
  • If not intentional: prune ping_triggers with the transmission in PruneOldPackets, or add PruneOrphanPingTriggers like the route_mask_changes one, with a test. First confirm that the ping-score history keeps the all-time records without them.

Acceptance

Activity

  1. added a commit that references this issue on Oct 7, 2026
  2. dborup commented on Oct 7, 2026

    @dborup
    OwnerAuthor

    Fixed by #349 (merged as a2d60497a330a03c146a7089d28b02ab2da7b54c).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions