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

[swss] Adding conditional for bgp when on multi ASIC platform #11691

Merged
merged 2 commits into from
Aug 12, 2022

Conversation

Ndancejic
Copy link
Contributor

bgp should be a per-asic service, and runs for each namespace on
multi-asic platforms. However, putting bgp in MULTI_INST_DEPENDENT
causes swss to be restarted as well as bgp. this is causing issues after #11000

Issue: #11653

This fix:

  • removes bgp from dependents list
  • adds a conditional that either adds bgp, or bgp@$DEV to separate
    between single and multi-asic platforms

Signed-off-by: Nikola Dancejic [email protected]

Why I did it

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)

bgp should be a per-asic service, and runs for each namespace on
multi-asic platforms. However, putting bgp in MULTI_INST_DEPENDENT
causes swss to be restarted as well as bgp. this is causing issues after

Issue: sonic-net#11653

This fix:
- removes bgp from dependents list
- adds a conditional that either adds bgp, or bgp@$DEV to separate
between single and multi-asic platforms

Signed-off-by: Nikola Dancejic <[email protected]>
@wenyiz2021
Copy link
Contributor

checking multi-asic behavior on this

@SuvarnaMeenakshi
Copy link
Contributor

Change looks good on multi-asic vs:
no bgp service in default namespace
stop of swss@0 stops bgp@0
stop of bgp@0 does not stop swss@0.

admin@vlab-08:~$ sudo systemctl status bgp
● bgp.service - BGP container
     Loaded: loaded (/lib/systemd/system/bgp.service; disabled; vendor preset: enabled)
     Active: inactive (dead)
admin@vlab-08:~$ sudo systemctl status bgp@0
● [email protected] - BGP container
     Loaded: loaded (/lib/systemd/system/[email protected]; enabled; vendor preset: enabled)
    Drop-In: /etc/systemd/system/[email protected]
             └─auto_restart.conf
     Active: active (running) since Thu 2022-08-11 19:29:48 UTC; 1min 21s ago
   Main PID: 17733 (bgp.sh)
      Tasks: 3 (limit: 8836)
     Memory: 19.0M
     CGroup: /system.slice/system-bgp.slice/[email protected]
             ├─17733 /bin/bash /usr/local/bin/bgp.sh wait 0
             ├─17803 /bin/bash /usr/bin/bgp.sh wait 0
             └─17823 python3 /usr/local/bin/container wait bgp0

..
admin@vlab-08:~$ sudo systemctl stop swss@0

admin@vlab-08:~$ sudo systemctl status bgp@0
● [email protected] - BGP container
     Loaded: loaded (/lib/systemd/system/[email protected]; enabled; vendor preset: enabled)
    Drop-In: /etc/systemd/system/[email protected]
             └─auto_restart.conf
     Active: inactive (dead) since Thu 2022-08-11 19:31:48 UTC; 2min 4s ago
    Process: 17733 ExecStart=/usr/local/bin/bgp.sh wait 0 (code=exited, status=0/SUCCESS)
    Process: 26179 ExecStop=/usr/local/bin/bgp.sh stop 0 (code=exited, status=0/SUCCESS)
    Process: 26297 ExecStopPost=/usr/local/bin/write_standby.py (code=exited, status=0/SUCCESS)
   Main PID: 17733 (code=exited, status=0/SUCCESS)

..
admin@vlab-08:~$ sudo systemctl status swss@0
● [email protected] - switch state service
     Loaded: loaded (/lib/systemd/system/[email protected]; enabled; vendor preset: enabled)
    Drop-In: /etc/systemd/system/[email protected]
             └─auto_restart.conf
     Active: inactive (dead) since Thu 2022-08-11 19:31:52 UTC; 2min 9s ago
    Process: 19782 ExecStart=/usr/local/bin/swss.sh wait 0 (code=exited, status=0/SUCCESS)
    Process: 25959 ExecStop=/usr/local/bin/swss.sh stop 0 (code=exited, status=0/SUCCESS)
   Main PID: 19782 (code=exited, status=0/SUCCESS)
..
admin@vlab-08:~$ sudo systemctl start swss@0

admin@vlab-08:~$ sudo systemctl status swss@0
● [email protected] - switch state service
     Loaded: loaded (/lib/systemd/system/[email protected]; enabled; vendor preset: enabled)
    Drop-In: /etc/systemd/system/[email protected]
             └─auto_restart.conf
     Active: active (running) since Thu 2022-08-11 19:34:12 UTC; 5s ago
    Process: 26921 ExecStartPre=/usr/local/bin/swss.sh start 0 (code=exited, status=0/SUCCESS)
   Main PID: 27147 (swss.sh)
      Tasks: 2 (limit: 8836)
     Memory: 1.5M
     CGroup: /system.slice/system-swss.slice/[email protected]
             ├─27147 /bin/bash /usr/local/bin/swss.sh wait 0
             └─27736 /bin/systemctl start teamd@0

..
admin@vlab-08:~$ sudo systemctl status bgp@0
● [email protected] - BGP container
     Loaded: loaded (/lib/systemd/system/[email protected]; enabled; vendor preset: enabled)
    Drop-In: /etc/systemd/system/[email protected]
             └─auto_restart.conf
     Active: active (running) since Thu 2022-08-11 19:34:17 UTC; 4s ago
    Process: 27589 ExecStartPre=/usr/local/bin/bgp.sh start 0 (code=exited, status=0/SUCCESS)
   Main PID: 27734 (bgp.sh)
      Tasks: 3 (limit: 8836)
     Memory: 19.0M
     CGroup: /system.slice/system-bgp.slice/[email protected]
             ├─27734 /bin/bash /usr/local/bin/bgp.sh wait 0
             ├─27738 /bin/bash /usr/bin/bgp.sh wait 0
             └─27751 python3 /usr/local/bin/container wait bgp0

..
admin@vlab-08:~$ sudo systemctl stop bgp@0
admin@vlab-08:~$ sudo systemctl status bgp@0
● [email protected] - BGP container
     Loaded: loaded (/lib/systemd/system/[email protected]; enabled; vendor preset: enabled)
    Drop-In: /etc/systemd/system/[email protected]
             └─auto_restart.conf
     Active: inactive (dead) since Thu 2022-08-11 19:34:36 UTC; 2s ago
    Process: 27589 ExecStartPre=/usr/local/bin/bgp.sh start 0 (code=exited, status=0/SUCCESS)
    Process: 27734 ExecStart=/usr/local/bin/bgp.sh wait 0 (code=exited, status=0/SUCCESS)
    Process: 28378 ExecStop=/usr/local/bin/bgp.sh stop 0 (code=exited, status=0/SUCCESS)
    Process: 28433 ExecStopPost=/usr/local/bin/write_standby.py (code=exited, status=0/SUCCESS)
   Main PID: 27734 (code=exited, status=0/SUCCESS)

..
admin@vlab-08:~$ sudo systemctl status swss@0
● [email protected] - switch state service
     Loaded: loaded (/lib/systemd/system/[email protected]; enabled; vendor preset: enabled)
    Drop-In: /etc/systemd/system/[email protected]
             └─auto_restart.conf
     Active: active (running) since Thu 2022-08-11 19:34:12 UTC; 29s ago
    Process: 26921 ExecStartPre=/usr/local/bin/swss.sh start 0 (code=exited, status=0/SUCCESS)
   Main PID: 27147 (swss.sh)
      Tasks: 5 (limit: 8836)
     Memory: 18.5M
     CGroup: /system.slice/system-swss.slice/[email protected]
             ├─27147 /bin/bash /usr/local/bin/swss.sh wait 0
             └─27961 python3 /usr/bin/docker-wait-any -s swss0 -d syncd0 teamd0

..

@wenyiz2021
Copy link
Contributor

wenyiz2021 commented Aug 11, 2022

This looks good on the pipeline dut, bgp on duthost wasn't coming up
admin@vlab-08:~$ docker ps -a | grep bgp
c162911ad1e0 docker-fpm-frr:latest "/usr/bin/docker_ini…" 20 minutes ago Up 20 minutes bgp2
28b641b4a27c docker-fpm-frr:latest "/usr/bin/docker_ini…" 20 minutes ago Up 20 minutes bgp1
659a1e7a71ad docker-fpm-frr:latest "/usr/bin/docker_ini…" 20 minutes ago Up 20 minutes bgp3
d37fe0455ab7 docker-fpm-frr:latest "/usr/bin/docker_ini…" 20 minutes ago Up 20 minutes bgp0

Copy link
Contributor

@SuvarnaMeenakshi SuvarnaMeenakshi left a comment

Choose a reason for hiding this comment

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

lgtm

@SuvarnaMeenakshi SuvarnaMeenakshi merged commit 23dcfdf into sonic-net:master Aug 12, 2022
yxieca pushed a commit that referenced this pull request Aug 17, 2022
bgp should be a per-asic service, and runs for each namespace on
multi-asic platforms. However, putting bgp in MULTI_INST_DEPENDENT
causes swss to be restarted as well as bgp. this is causing issues after #11000

Issue: #11653

This fix:

removes bgp from dependents list
adds a conditional that either adds bgp, or bgp@$DEV to separate
between single and multi-asic platforms
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.

5 participants