indexer: enriched MSDP views (peers, pim_sa_cache, sa_cache)#620
Merged
Conversation
vihu
approved these changes
Jun 3, 2026
vihu
left a comment
Contributor
There was a problem hiding this comment.
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.
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
force-pushed
the
bc/enriched-msdp
branch
from
June 3, 2026 15:21
2901e7a to
9cde44b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds three ClickHouse views enriching
dz_ip_msdp_*_currentwith device, group, and publisher attribution:enriched_ip_msdp_peers— joins each MSDP peer session to the local device and (viadz_device_interface_ipsfrom the parent PR) the remote peer device. The 172.16.x.x mesh-spacepeer_addressresolves to whichever device has that IP on one of its interfaces, exposingpeer_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 (viasource_address→ user'sdz_ipwhen the group is in the publishers list).rp_addressleft raw — production uses anycast10.0.0.0which doesn't map to a specific device.enriched_ip_msdp_sa_cache— same enrichments as PIM SA cache, plus remote device resolution viadz_device_interface_ips(mapping the 172.16.x.xremote_addressto a device pubkey + code).sa.statusis aliased toaccept_statusto disambiguate frommulticast_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 thedz_device_interface_ipsview introduced there. Merge PR 1 first; this should be rebased / merged onto main afterwards.Testing Verification
TestMigration_Appliesextended 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, assertsaccept_status = 'accepted',source_match_status = 'publisher_matched', plus all peer/publisher codes are populated.Refs malbeclabs/infra#1418.