Remove a peer's live routes when its session goes down (closes #56)
check / check (push) Canceled after 0s
check / check (push) Canceled after 0s
RIS sends no withdrawals for the routes of a peer whose BGP session goes down, so routewatch kept them. The streamer now hands STATE messages to the prefix handler. They are never dropped for backpressure: one that finds the queue full is held and queued first once there is room, and the handler's other messages are dropped meanwhile, so none overtakes it. Nothing waits. On a down, the prefix handler drops the peer's pending updates and its next flush deletes all the peer's live routes before the batch's other writes, keeping the in-memory counts exact. The live route tables are unique on peer and prefix, which also finds a peer's routes. Model: opus-5-5
This commit was merged in pull request #88.
This commit is contained in:
@@ -107,7 +107,10 @@ CREATE TABLE IF NOT EXISTS live_routes_v4 (
|
||||
as_path TEXT NOT NULL, -- JSON array
|
||||
next_hop TEXT NOT NULL,
|
||||
last_updated DATETIME NOT NULL,
|
||||
UNIQUE(prefix, peer_ip) -- a peer has at most one route for a prefix
|
||||
-- A peer has at most one route for a prefix. peer_ip comes first so that
|
||||
-- this key also finds all of a peer's routes, when its BGP session goes
|
||||
-- down; lookups by prefix use the prefix index below.
|
||||
UNIQUE(peer_ip, prefix)
|
||||
);
|
||||
|
||||
-- IPv6 routing table maintained by PrefixHandler
|
||||
@@ -120,7 +123,8 @@ CREATE TABLE IF NOT EXISTS live_routes_v6 (
|
||||
as_path TEXT NOT NULL, -- JSON array
|
||||
next_hop TEXT NOT NULL,
|
||||
last_updated DATETIME NOT NULL,
|
||||
UNIQUE(prefix, peer_ip) -- a peer has at most one route for a prefix
|
||||
-- As in live_routes_v4: peer_ip first, to find all of a peer's routes.
|
||||
UNIQUE(peer_ip, prefix)
|
||||
);
|
||||
|
||||
-- Indexes for live_routes_v4 table
|
||||
|
||||
Reference in New Issue
Block a user