-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
config qos reload followed by config save commands leads to config save command failing with traceback #8888
Closed
Comments
@rajendra-dendukuri Can you please look into this? |
i agree with the analysis. kdump should not save to startup config directly. |
@lguohan can you update on the status? what are the next step here. we need this fix for 202106. |
lguohan
pushed a commit
to sonic-net/sonic-utilities
that referenced
this issue
Oct 7, 2021
) Fix sonic-net/sonic-buildimage#8888 Warn user to save the config instead of saving the kdump config in config_db.json under the covers. Having more than one actors operate on config_db.json can result in an exception.
malletvapid23
added a commit
to malletvapid23/Sonic-Utility
that referenced
this issue
Aug 3, 2023
…859) Fix sonic-net/sonic-buildimage#8888 Warn user to save the config instead of saving the kdump config in config_db.json under the covers. Having more than one actors operate on config_db.json can result in an exception.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
Sometimes, config qos reload followed by config save commands leads to config save command failing with traceback.
The reason for the traceback is, config qos reload triggers a write to DB and a write to config db triggers hostcfgd to update kdump. (There are no duplicate checks) https://github.com/Azure/sonic-buildimage/blob/b2659dcdbc454ceee5128a597fb34f041b1aeb9f/src/sonic-host-services/scripts/hostcfgd#L742
As part of kdump processing, some changes were introduced to save to startup config file.
sonic-net/sonic-utilities#1284
While this is executing and writing to config file in the background, config save command too writes to config file. As part of the flow to write to config_db.json the file is first read using read_json_file and then sorted.
If this happens simultaneously with the flow where kdump directly writes to config file, the trackback is observed. Since there are no file protection mechanisms implemented it results in reading incomplete data in the middle of the write.
Ideally the config save command alone should write to config_db.json. If multiple writers are required, then file protection mechanisms should be implemented to avoid reading incorrect data during writes.
Below is an example of the failed traceback.
Steps to reproduce the issue:
Describe the results you received:
config save fails with a crash
Describe the results you expected:
config save shouldn't fail.
Output of
show version
:Output of
show techsupport
:Additional information you deem important (e.g. issue happens only occasionally):
The text was updated successfully, but these errors were encountered: