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

[qos reload] Fix "config qos reload" overriding entire CONFIG_DB #3479

Merged
merged 2 commits into from
Sep 3, 2024

Conversation

stepanblyschak
Copy link
Contributor

@stepanblyschak stepanblyschak commented Aug 7, 2024

Fixes sonic-net/sonic-buildimage#15894

What I did

config qos reload command uses a combination of sonic-cfggen's flags -d and --write-to-db that makes it override entire CONFIG_DB, updating every key. This leads to issues with Orchs, daemons that do not support updating keys in CONFIG_DB. Best case, it causes errors in logs.

How I did it

First, render templates to temporary files, then load those files into CONFIG_DB.
Also, fixed an issue where using dry_run option only produced QOS config but not the buffer configuration and updated test files accordingly.

How to verify it

Run on switch:

root@sonic/home/admin# config qos reload
Running command: /usr/local/bin/sonic-cfggen -d -t /usr/share/sonic/device/x86_64-mlnx_msn2100-r0/ACS-MSN2100/buffers_dynamic.json.j2,/tmp/cfg_buffer.json -t /usr/share/sonic/device/x86_64-mlnx_msn2100-r0/ACS-MSN2100/qos.json.j2,/tmp/cfg_qos.json -y /etc/sonic/sonic_version.yml
Running command: /usr/local/bin/sonic-cfggen -j /tmp/cfg_buffer.json -j /tmp/cfg_qos.json --write-to-db

Previous command output (if the output of a command-line utility has changed)

New command output (if the output of a command-line utility has changed)

Signed-off-by: Stepan Blyschak <stepanb@nvidia.com>
@stepanblyschak
Copy link
Contributor Author

Request for 202405

Signed-off-by: Stepan Blyschak <stepanb@nvidia.com>
@liat-grozovik liat-grozovik merged commit 4c7e54a into sonic-net:master Sep 3, 2024
7 checks passed
mssonicbld pushed a commit to mssonicbld/sonic-utilities that referenced this pull request Sep 6, 2024
…ic-net#3479)

Fixes sonic-net/sonic-buildimage#15894

- What I did
config qos reload command uses a combination of sonic-cfggen's flags -d and --write-to-db that makes it override entire CONFIG_DB, updating every key. This leads to issues with Orchs, daemons that do not support updating keys in CONFIG_DB. Best case, it causes errors in logs.

- How I did it
First, render templates to temporary files, then load those files into CONFIG_DB.
Also, fixed an issue where using dry_run option only produced QOS config but not the buffer configuration and updated test files accordingly.

- How to verify it
Run on switch:

root@sonic/home/admin# config qos reload
Running command: /usr/local/bin/sonic-cfggen -d -t /usr/share/sonic/device/x86_64-mlnx_msn2100-r0/ACS-MSN2100/buffers_dynamic.json.j2,/tmp/cfg_buffer.json -t /usr/share/sonic/device/x86_64-mlnx_msn2100-r0/ACS-MSN2100/qos.json.j2,/tmp/cfg_qos.json -y /etc/sonic/sonic_version.yml
Running command: /usr/local/bin/sonic-cfggen -j /tmp/cfg_buffer.json -j /tmp/cfg_qos.json --write-to-db

Signed-off-by: Stepan Blyschak <stepanb@nvidia.com>
@mssonicbld
Copy link
Collaborator

Cherry-pick PR to 202405: #3532

mssonicbld pushed a commit that referenced this pull request Sep 6, 2024
Fixes sonic-net/sonic-buildimage#15894

- What I did
config qos reload command uses a combination of sonic-cfggen's flags -d and --write-to-db that makes it override entire CONFIG_DB, updating every key. This leads to issues with Orchs, daemons that do not support updating keys in CONFIG_DB. Best case, it causes errors in logs.

- How I did it
First, render templates to temporary files, then load those files into CONFIG_DB.
Also, fixed an issue where using dry_run option only produced QOS config but not the buffer configuration and updated test files accordingly.

- How to verify it
Run on switch:

root@sonic/home/admin# config qos reload
Running command: /usr/local/bin/sonic-cfggen -d -t /usr/share/sonic/device/x86_64-mlnx_msn2100-r0/ACS-MSN2100/buffers_dynamic.json.j2,/tmp/cfg_buffer.json -t /usr/share/sonic/device/x86_64-mlnx_msn2100-r0/ACS-MSN2100/qos.json.j2,/tmp/cfg_qos.json -y /etc/sonic/sonic_version.yml
Running command: /usr/local/bin/sonic-cfggen -j /tmp/cfg_buffer.json -j /tmp/cfg_qos.json --write-to-db

Signed-off-by: Stepan Blyschak <stepanb@nvidia.com>
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.

Syslog error messages are observed when doing qos reload with EVPN/VxLAN configurations
6 participants