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

[bgpcfgd] improve the log when delete a loopback interface #11152

Merged
merged 2 commits into from
Jul 29, 2022

Conversation

StormLiangMS
Copy link
Contributor

Why I did it

The bgpcfgd doesn't support deletion of 'zebra set src', if an interface is deleted, the bgpcfgd will drop a warning message. In current implementation, we only care about the loopback0 interface but not others.
To improve the log print to have the key info, which will give the name of the deleted interface. We can ignore it if it is not the loopback0 interface. The application layer should be aware of that update and deletion is not supported, delete or update with a new address of loopback0 could cause issue, this log can give enough info to root cause the issue.

How I did it

How to verify it

Which release branch to backport (provide reason below if selected)

  • 201811
  • 201911
  • 202006
  • 202012
  • 202106
  • 202111
  • 202205

Description for the changelog

Link to config_db schema for YANG module changes

A picture of a cute animal (not mandatory but encouraged)

Copy link
Contributor

@prsunny prsunny left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to have a test for this?

@wen587
Copy link
Contributor

wen587 commented Jun 16, 2022

Hi @StormLiangMS, is the bgpcfgd using zebra? Is it an issue when deleting the loopback interface?
Please see the below scenario, it will warn us when we remove loopback by CLI.

Remove Loopback interface through Config CLI:

admin@vlab-01:~$ show ip int | grep Loop
Loopback0                 10.1.0.32/32         up/up         N/A             N/A
admin@vlab-01:~$ sudo config interface ip remove Loopback0 10.1.0.32/32
admin@vlab-01:~$

Check Syslog:

admin@vlab-01:~$ show logging -f
...
Jun  1 06:13:45.658305 vlab-01 DEBUG bgp#bgpcfgd: Received message : '('Loopback0|10.1.0.32/32', 'DEL', ())'
Jun  1 06:13:45.658305 vlab-01 WARNING bgp#bgpcfgd: Delete command is not supported for 'zebra set src' templates

@StormLiangMS
Copy link
Contributor Author

Hi @StormLiangMS, is the bgpcfgd using zebra? Is it an issue when deleting the loopback interface? Please see the below scenario, it will warn us when we remove loopback by CLI.

Remove Loopback interface through Config CLI:

admin@vlab-01:~$ show ip int | grep Loop
Loopback0                 10.1.0.32/32         up/up         N/A             N/A
admin@vlab-01:~$ sudo config interface ip remove Loopback0 10.1.0.32/32
admin@vlab-01:~$

Check Syslog:

admin@vlab-01:~$ show logging -f
...
Jun  1 06:13:45.658305 vlab-01 DEBUG bgp#bgpcfgd: Received message : '('Loopback0|10.1.0.32/32', 'DEL', ())'
Jun  1 06:13:45.658305 vlab-01 WARNING bgp#bgpcfgd: Delete command is not supported for 'zebra set src' templates

@wen587

  1. bgpcfgd will pass this configuration to zebra to have the source IP for the route. 2. deletion and update is not supported, if the loopback0 interface is removed, currently bgpcfgd will do nothing. And the routes which distributed to kernel would be deleted.

@StormLiangMS
Copy link
Contributor Author

Do we need to have a test for this?

@prsunny Yes, changed the unit test for this new log changes.

@StormLiangMS StormLiangMS merged commit 8d37dd7 into sonic-net:master Jul 29, 2022
@StormLiangMS StormLiangMS deleted the log_improve branch July 29, 2022 15:33
yxieca pushed a commit that referenced this pull request Aug 8, 2022
Why I did it
The bgpcfgd doesn't support deletion of 'zebra set src', if an interface is deleted, the bgpcfgd will drop a warning message. In current implementation, we only care about the loopback0 interface but not others.
To improve the log print to have the key info, which will give the name of the deleted interface. We can ignore it if it is not the loopback0 interface. The application layer should be aware of that update and deletion is not supported, delete or update with a new address of loopback0 could cause issue, this log can give enough info to root cause the issue.

How I did it
How to verify it
skbarista pushed a commit to skbarista/sonic-buildimage that referenced this pull request Aug 17, 2022
…#11152)

Why I did it
The bgpcfgd doesn't support deletion of 'zebra set src', if an interface is deleted, the bgpcfgd will drop a warning message. In current implementation, we only care about the loopback0 interface but not others.
To improve the log print to have the key info, which will give the name of the deleted interface. We can ignore it if it is not the loopback0 interface. The application layer should be aware of that update and deletion is not supported, delete or update with a new address of loopback0 could cause issue, this log can give enough info to root cause the issue.

How I did it
How to verify it
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants