Never move last seen back or first seen forward (closes #162)
check / check (push) Canceled after 0s
check / check (push) Canceled after 0s
Some RIS collectors send updates days old while they catch up on a backlog. Every update to a stored AS, peering or peer set last_seen to the update's time, even an older one, and never lowered first_seen. An AS page could then list a peer first seen after it was last seen. The update statements for asns, peerings and bgp_peers now keep the earlier of the stored and new first_seen and the later of the stored and new last_seen, with MIN and MAX in the SQL. The batch and the single-row writes share each statement. GetOrCreateASN returns the times the row now holds. Route times are unchanged. Model: opus-5-5
This commit is contained in:
@@ -125,8 +125,8 @@ type LiveRouteDeletion struct {
|
||||
|
||||
// SeenTimes is the earliest and the latest time one batch of updates saw an AS,
|
||||
// a peer or a peering. A row the batch adds is stored first seen at First and
|
||||
// last seen at Last; a row already stored keeps its first_seen and has its
|
||||
// last_seen set to Last.
|
||||
// last seen at Last. A row already stored takes First as its first_seen only
|
||||
// when First is earlier, and Last as its last_seen only when Last is later.
|
||||
type SeenTimes struct {
|
||||
First time.Time
|
||||
Last time.Time
|
||||
|
||||
Reference in New Issue
Block a user