-
Notifications
You must be signed in to change notification settings - Fork 707
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Do not preserve MPReachNLRI attribute the way we receive it from wire #2863
base: master
Are you sure you want to change the base?
Conversation
pkg/config/oc/bgp_configs.go
Outdated
@@ -3175,9 +3215,6 @@ type NeighborConfig struct { | |||
// original -> bgp:peer-group | |||
// The peer-group with which this neighbor is associated. | |||
PeerGroup string `mapstructure:"peer-group" json:"peer-group,omitempty"` | |||
// original -> gobgp:send-software-version | |||
// gobgp:send-software-version's original type is boolean. | |||
SendSoftwareVersion bool `mapstructure:"send-software-version" json:"send-software-version,omitempty"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Honestly, I do not know why this didn't surface up earlier.
neighbor-interface
is defined at line 919 https://github.com/osrg/gobgp/blob/master/tools/pyang_plugins/gobgp.yang#L919
send-software-version
at 1010: https://github.com/osrg/gobgp/blob/master/tools/pyang_plugins/gobgp.yang#L1010
It is logical that it goes after it.
Changing order of field broke test, though, so I fixed overrideConfig()
in a separate commit
I can't recall why but we preserve that attribute for bmp/mrt? |
@fujita, per my understanding:
|
Makefile
Outdated
@@ -0,0 +1,50 @@ | |||
SHELL := /bin/bash -o pipefail |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's this Makefile?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ughh, it's from our internal build system, it shouldn't be here :(
Anyway, I've rewritten commit and removed config option
I think that we can drop the config option because this doesn't break the gRPC API. |
MPReachNLRI attribute as is. This causes trouble if GoBGP has a neighbor that merges multiple NLRIs having same nexthop in a single BGP update message and if GoBGP has a watcher. Thus watcher receives up to n^2 nlris (n paths each containing n NLRIs) causing enormous memory consumption (since serialization/deserialization removes deduplication). Since having all NLRIs in each path is useless in most cases, the behavior is changed so only relevant NLRI is present in BGP path. In our tests memory consumption of such watcher had reduced from 19 Gb to 2Gb (with around 300K routes in RIB).
077971a
to
60a5759
Compare
@@ -516,13 +516,12 @@ func OverwriteNeighborConfigWithPeerGroup(c *Neighbor, pg *PeerGroup) error { | |||
|
|||
func overwriteConfig(c, pg interface{}, tagPrefix string, v *viper.Viper) { | |||
nValue := reflect.Indirect(reflect.ValueOf(c)) | |||
nType := reflect.Indirect(nValue).Type() | |||
pgValue := reflect.Indirect(reflect.ValueOf(pg)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes to this file are related with this pull request?
Right now
table.ProcessMessage()
rebuilds attribute list, but preservesMPReachNLRI attribute as is. This causes trouble if GoBGP has a neighbor
that merges multiple NLRIs having same nexthop in a single BGP update
message and if GoBGP has a watcher. Thus watcher receives up to n^2
nlris (n paths each containing n NLRIs) causing enormous memory
consumption (since serialization/deserialization removes deduplication).
Since having all NLRIs in each path is useless in most cases, the
behavior is changed so only relevant NLRI is present in BGP path, but
for backward compatibility old behavior can be reenabled using config
option:
In our tests memory consumption of such watcher had reduced from 19 Gb
to 2Gb (with around 300K routes in RIB).