Skip to content

indexer: enriched MSDP views (peers, pim_sa_cache, sa_cache)#620

Merged
ben-malbeclabs merged 2 commits into
mainfrom
bc/enriched-msdp
Jun 3, 2026
Merged

indexer: enriched MSDP views (peers, pim_sa_cache, sa_cache)#620
ben-malbeclabs merged 2 commits into
mainfrom
bc/enriched-msdp

Conversation

@ben-malbeclabs

Copy link
Copy Markdown
Contributor

Summary

Adds three ClickHouse views enriching dz_ip_msdp_*_current with device, group, and publisher attribution:

  • enriched_ip_msdp_peers — joins each MSDP peer session to the local device and (via dz_device_interface_ips from the parent PR) the remote peer device. The 172.16.x.x mesh-space peer_address resolves to whichever device has that IP on one of its interfaces, exposing peer_device_pk + peer_device_code + peer_interface_name. Verified empirically: 96/96 production mainnet MSDP peers map to a device this way.
  • enriched_ip_msdp_pim_sa_cache — joins each PIM SA cache entry to local device, multicast group, and publisher user (via source_address → user's dz_ip when the group is in the publishers list). rp_address left raw — production uses anycast 10.0.0.0 which doesn't map to a specific device.
  • enriched_ip_msdp_sa_cache — same enrichments as PIM SA cache, plus remote device resolution via dz_device_interface_ips (mapping the 172.16.x.x remote_address to a device pubkey + code). sa.status is aliased to accept_status to disambiguate from multicast_group_status. Verified empirically: 617/616 production mainnet SA cache rows match a device this way (one source matched two devices, handled by LEFT ANY JOIN).

Stacking

PR 2 of 3 for infra#1418. Base: bc/enriched-mroute (PR 1) — this branch depends on the dz_device_interface_ips view introduced there. Merge PR 1 first; this should be rebased / merged onto main afterwards.

Testing Verification

  • TestMigration_Applies extended to cover all three new views.
  • TestEnrichedView_MSDPPeers — inserts two devices (sea + nyc, nyc has the peer address on a Loopback interface), then an MSDP peer row. Asserts the peer_address resolves to nyc's device pubkey + code + interface name.
  • TestEnrichedView_MSDPSACache — full round-trip exercising remote-device resolution + group join + publisher attribution, asserts accept_status = 'accepted', source_match_status = 'publisher_matched', plus all peer/publisher codes are populated.

Refs malbeclabs/infra#1418.

@ben-malbeclabs ben-malbeclabs self-assigned this Jun 2, 2026
@ben-malbeclabs
ben-malbeclabs marked this pull request as ready for review June 2, 2026 22:13

@vihu vihu left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a nitpick, enriched_ip_msdp_pim_sa_cache has migration-existence coverage, but peers and SA-cache have direct round-trip tests while PIM-SA does not. A small PIM-SA round-trip test would make the coverage symmetrical, but I don't think that's blocking.

Base automatically changed from bc/enriched-mroute to main June 3, 2026 15:07
Adds three enriched views on top of dz_ip_msdp_*_current:

  - enriched_ip_msdp_peers: joins to local device + remote device via
    dz_device_interface_ips (resolves the 172.16.x.x mesh-space peer_address
    back to a device pubkey + code).

  - enriched_ip_msdp_pim_sa_cache: joins to local device + multicast group +
    publisher user (via source_address → user.dz_ip when the group is in the
    publishers list). rp_address left raw; anycast (10.0.0.0) doesn't map to
    a specific device.

  - enriched_ip_msdp_sa_cache: same enrichments as pim_sa_cache, plus remote
    device resolution via dz_device_interface_ips. sa.status is aliased to
    accept_status to disambiguate from multicast_group_status.

Stacks on the dz_device_interface_ips view introduced in the prior commit
(enriched_ip_mroute view). Migration applies cleanly + per-view round-trip
test verifies the joins return the expected enrichment columns.

Refs malbeclabs/infra#1418.
@ben-malbeclabs
ben-malbeclabs merged commit 1dc2d23 into main Jun 3, 2026
5 checks passed
@ben-malbeclabs
ben-malbeclabs deleted the bc/enriched-msdp branch June 3, 2026 15:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants