bgp / stayrtr

RPKI-To-Router server implementation in Go
BSD 3-Clause "New" or "Revised" License
95 stars 14 forks source link

Don't count the wrong things #116

Closed cjeker closed 7 months ago

cjeker commented 7 months ago

The count in processData() makes little sense as a return value, one can count the various slices with len() just as easily. Especially since it does not include the vap and bgpsec keys.

As a result reloadFromCurrentState() gets utterly confused and creates new versions when there is no change.

Fix for #114

ties commented 7 months ago

Is my read correct that the only use left for countv4/countv6 is pre-deduplication counts for metrics?

cjeker commented 7 months ago

Yes, pretty much.

ties commented 7 months ago

...and the test.

I would almost remove it, since you can mistake it with some of the other ints in the result, with bad results.

cjeker commented 7 months ago

Right now this fixes a real bug. Removing more is always possible but should be a step on top of this.

ties commented 7 months ago

Right now this fixes a real bug. Removing more is always possible but should be a step on top of this.

To me addressing that was well would remove the root cause of the bug as well. But this fixes a real bug as is, so lgtm