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

[action] [PR:3479] [qos reload] Fix "config qos reload" overriding entire CONFIG_DB (#3479) #3532

Merged
merged 1 commit into from
Sep 6, 2024

Conversation

mssonicbld
Copy link
Collaborator

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

…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 Author

Original PR: #3479

@mssonicbld mssonicbld merged commit fb6dd58 into sonic-net:202405 Sep 6, 2024
7 checks passed
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.

2 participants