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

Improve load_mingraph to wait eth0 restart before exit #3365

Merged

Conversation

liuh-80
Copy link
Contributor

@liuh-80 liuh-80 commented Jun 12, 2024

Improve load_mingraph to wait eth0 restart before exit

Why I did it

load_minigraph will restart eth0, which cause device randomly lost network for 10-20 seconds after load_minigraph
When enable TACACS, this will cause commands randomly failed after load_minigraph

How I did it

Wait interfaces-config and networking service restart after restart all sonic.target services.
Work item tracking
  • Microsoft ADO: 28302676

How to verify it

Pass all test case.
Add new test case.
Manually check on test device:
admin@TEST_DEVICE:~$ date && sudo config load_minigraph -y && date
Wed Jun 12 08:30:59 AM UTC 2024
Stopping SONiC target ...
Running command: /usr/local/bin/sonic-cfggen -H -m -j /etc/sonic/init_cfg.json --write-to-db
Running command: /usr/local/bin/sonic-cfggen -d -y /etc/sonic/sonic_version.yml -t /usr/share/sonic/templates/sonic-environment.j2,/etc/sonic/sonic-environment
Running command: config qos reload --no-dynamic-buffer --no-delay
Running command: /usr/local/bin/sonic-cfggen -d --write-to-db -t /usr/share/sonic/device/x86_64-mlnx_msn2700-r0/Mellanox-SN2700-D48C8/buffers.json.j2,config-db -t /usr/share/sonic/device/x86_64-mlnx_msn2700-r0/Mellanox-SN2700-D48C8/qos.json.j2,config-db -y /etc/sonic/sonic_version.yml
Buffer calculation model updated, restarting swss is required to take effect
Running command: pfcwd start_default
Restarting SONiC target ...
Enabling container monitoring ...
Reloading Monit configuration ...
Reinitializing monit daemon
Please note setting loaded from minigraph will be lost after system reboot. To preserve setting, run `config save`.
Wed Jun 12 08:32:17 AM UTC 2024
admin@TEST_DEVICE:~$


In syslog, eth0 restart before load_minigraph finish:

2024 Jun 12 08:31:50.743828 TEST_DEVICE INFO systemd-networkd[358]: eth0: Link DOWN
2024 Jun 12 08:31:50.743957 TEST_DEVICE INFO systemd-networkd[358]: eth0: Lost carrier

2024 Jun 12 08:31:58.182663 TEST_DEVICE INFO interfaces-config.sh[15321]: net.ipv6.conf.eth0.accept_ra_defrtr = 0
2024 Jun 12 08:31:58.182777 TEST_DEVICE INFO interfaces-config.sh[15321]: net.ipv6.conf.eth0.accept_ra = 0
2024 Jun 12 08:31:58.182838 TEST_DEVICE INFO interfaces-config.sh[15321]: net.ipv6.conf.eth0.ra_defrtr_metric = 1996489704

2024 Jun 12 08:32:08.572423 TEST_DEVICE INFO systemd-networkd[358]: eth0: Link UP

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

  • 202305
  • 202311
  • 202405

Tested branch (Please provide the tested image version)

will updated with this PR image later.

  • SONiC.202305.562827-f73bc5bfb
  • SONiC.202311.562838-e1f4859bf

Description for the changelog

Improve load_mingraph to wait eth0 restart before exit

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

@liuh-80
Copy link
Contributor Author

liuh-80 commented Jun 14, 2024

Need sonic-mgmt PR merge first:
sonic-net/sonic-mgmt#13277

Even without this PR, the sonic-mgmt PR still necessary.

@liuh-80 liuh-80 requested a review from saiarcot895 June 14, 2024 02:07
@liuh-80
Copy link
Contributor Author

liuh-80 commented Jun 14, 2024

Found a test case issue, need following PR merge first: sonic-net/sonic-mgmt#13302

@liuh-80
Copy link
Contributor Author

liuh-80 commented Jun 18, 2024

Verified with this POC PR: sonic-net/sonic-buildimage#19281, all test case passed

@liuh-80 liuh-80 merged commit 31f5fa8 into sonic-net:master Jun 18, 2024
7 checks passed
liuh-80 added a commit to liuh-80/sonic-utilities that referenced this pull request Jun 18, 2024
* Improve load_mingraph to wait eth0 restart before exist
@liuh-80
Copy link
Contributor Author

liuh-80 commented Jun 18, 2024

cherry-pick PR for 202305: #3371

liuh-80 added a commit to liuh-80/sonic-utilities that referenced this pull request Jun 18, 2024
* Improve load_mingraph to wait eth0 restart before exist
@liuh-80
Copy link
Contributor Author

liuh-80 commented Jun 18, 2024

Cherry-pick PR for 202311: #3372

StormLiangMS pushed a commit that referenced this pull request Jun 19, 2024
Improve load_mingraph to wait eth0 restart before exit
This is cherry-pick PR for #3365
yxieca pushed a commit that referenced this pull request Jun 21, 2024
* Improve load_mingraph to wait eth0 restart before exist
@mssonicbld
Copy link
Collaborator

Cherry-pick PR to 202405: #3464

mssonicbld pushed a commit that referenced this pull request Aug 2, 2024
* Improve load_mingraph to wait eth0 restart before exist
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