Skip to content
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

Fix cache invalidation on clear command #983

Merged

Conversation

bottleneko
Copy link
Contributor

Hello!

I'm getting problem with announce new routes to neighbours from config after clear command.

Routes will announced only to one neighbour but after restart or withdraw command on each route, exabgp will annonce routes to both neighbours

My config is:

process tcp-control-server {
    run ./exabgp-tcp-server.py /etc/exabgp/exabgp.env;
    encoder text;
}

template {
    neighbor common {
        router-id 10.0.0.1;
        local-address 10.0.0.1;

        local-as 65533;

        peer-as 65100;
    }
}

neighbor 10.0.1.1 { inherit common; }
neighbor 10.0.2.1 { inherit common; }

Steps to reproduce:

  1. Send announce commands to exabgp
announce route 10.0.3.1 next-hop self
announce route 10.0.4.1 next-hop self

After that

$ exabgpcli show adj-rib out
neighbor 10.0.1.1 ipv4 unicast 10.0.3.1/32 next-hop self
neighbor 10.0.1.1 ipv4 unicast 10.0.4.1/32 next-hop self
neighbor 10.0.2.1 ipv4 unicast 10.0.3.1/32 next-hop self
neighbor 10.0.2.1 ipv4 unicast 10.0.4.1/32 next-hop self
  1. Send clear command to exabgp clear adj-rib out
$ exabgpcli show adj-rib out
neighbor 10.0.1.1 ipv4 unicast 10.0.3.1/32 next-hop self
neighbor 10.0.1.1 ipv4 unicast 10.0.4.1/32 next-hop self
neighbor 10.0.2.1 ipv4 unicast 10.0.3.1/32 next-hop self
neighbor 10.0.2.1 ipv4 unicast 10.0.4.1/32 next-hop self
  1. Send announce commands to exabgp
announce route 10.0.3.1 next-hop self
announce route 10.0.4.1 next-hop self

After that

$ exabgpcli show adj-rib out
neighbor 10.0.1.1 ipv4 unicast 10.0.3.1/32 next-hop self
neighbor 10.0.1.1 ipv4 unicast 10.0.4.1/32 next-hop self
  1. Restart exabgp systemctl restart exabgp
$ exabgpcli show adj-rib out
neighbor 10.0.1.1 ipv4 unicast 10.0.3.1/32 next-hop self
neighbor 10.0.1.1 ipv4 unicast 10.0.4.1/32 next-hop self
neighbor 10.0.2.1 ipv4 unicast 10.0.3.1/32 next-hop self
neighbor 10.0.2.1 ipv4 unicast 10.0.4.1/32 next-hop self

This problem caused by withdrawing all announces in https://github.com/Exa-Networks/exabgp/blob/master/lib/exabgp/rib/outgoing.py#L92. Cached changes consist withdrew changes but they will not be invalidated because generator produces only announced changes from cache.

@thomas-mangin thomas-mangin merged commit f5c1cc5 into Exa-Networks:master Jun 2, 2020
@thomas-mangin
Copy link
Member

Thank you very much for this fix :-) Much appreciated.

@thomas-mangin
Copy link
Member

Could I ask you if you port this patch to branch 4.2 .. Sorry for being cheeky her but it would save me doing it and 5.0.0 is currently in flux so the fix should make it to the stable branch too.
Also you could use the occasion to add an entry to the CHANGELOG.rst too :-)

@bottleneko
Copy link
Contributor Author

Thanks you very much for fast merge :)

May you make release with this fix on current master or backport this changes into previous supported releases, please?

@bottleneko
Copy link
Contributor Author

Could I ask you if you port this patch to branch 4.2 .. Sorry for being cheeky her but it would save me doing it and 5.0.0 is currently in flux so the fix should make it to the stable branch too.
Also you could use the occasion to add an entry to the CHANGELOG.rst too :-)

Yes, of course, now I will make additional changes :)

@thomas-mangin
Copy link
Member

@bottleneko 4.2.10 released just for you 😉

@bottleneko
Copy link
Contributor Author

@thomas-mangin thanks you very much :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants