Stop now counts the origin changes inside a running write, in a new writingOriginChanges field, and adds them to the count it logs. The prune test checks which rows survive, including a prefix with rows on both sides of 72 hours. The prefix page tests cover 5,000 and 5,001 rows and a row's time and peer count. New tests cover the dropped-rows warning and the dropped count's reset. The prune floor is named minOriginChangesPerPrefix. The README, TODO, package doc and doc comments are corrected to match. Model: deepseek-v4-pro
This commit is contained in:
@@ -287,8 +287,9 @@ func (t *Table) PeersDown(peers []string) {
|
||||
// Load puts one prefix and origin AS pair that the database holds into the
|
||||
// table, as startup does with each row it reads. The change's peers join the
|
||||
// pair's peer set, and its routes are kept as an announcement's would be.
|
||||
// Unlike an update, Load records no change, so TakeChanges does not hand the
|
||||
// pair back to be written again. Loading a pair twice changes nothing.
|
||||
// Unlike an update, Load records no change and no origin change, so
|
||||
// TakeChanges does not hand the pair back to be written again. Loading a pair
|
||||
// twice changes nothing.
|
||||
//
|
||||
// The caller makes sure that every peer change names, in its peer set or in
|
||||
// its routes, has a number in Params.PeerNumbers.
|
||||
@@ -479,6 +480,7 @@ func (t *Table) removeOrigin(prefix netip.Prefix, o *origin) {
|
||||
// r in full when it is one of the two newest routes of o. The peer's earlier
|
||||
// route, if o keeps one, is replaced: it is no longer the peer's current route.
|
||||
// The pair is recorded as changed only when its peer set or kept routes change.
|
||||
// When r is the origin's first peer, an announced origin change is recorded.
|
||||
func (t *Table) join(prefix netip.Prefix, o *origin, r route) {
|
||||
if slices.ContainsFunc(o.routes, r.equal) {
|
||||
// The peer announced its kept route again.
|
||||
@@ -565,7 +567,8 @@ func (t *Table) dropKeptRoute(o *origin, peer uint) bool {
|
||||
// recordChange records that the pair of prefix and the AS of o changed, and
|
||||
// brings the count of origins without a kept route up to date.
|
||||
// wasWithoutKeptRoute says whether o was such an origin before the change. An
|
||||
// origin that no peer carries any more is removed.
|
||||
// origin that no peer carries any more is removed, and a withdrawn origin
|
||||
// change is recorded.
|
||||
func (t *Table) recordChange(
|
||||
prefix netip.Prefix, o *origin, wasWithoutKeptRoute bool,
|
||||
) {
|
||||
|
||||
Reference in New Issue
Block a user