[CRM]Handling Invalid CRM configuration gracefully #2109
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Signed-off-by: Sudharsan Dhamal Gopalarathnam sudharsand@nvidia.com
What I did
When CRM table contains some invalid configurations, the existing logic parses all field values above it and doesn't parse the field values below it. On hitting the unknown field, crm orch returns the execution leaving the crm database inconsistent. To handle this gracefully CRM orch will just log the unknown field and continue processing the fields below the unknown field.
For example when 202012 was misconfigured to have mpls_inseg_high_threshold which was not a supported field, the below error is thrown. However after this error the fields below 'mpls_inseg_high_threshold' are not parsed and fields above this field were parsed and programmed.
syslog.26.gz:Jan 10 14:55:54.520378 r-anaconda-71 ERR swss#orchagent: :- handleSetCommand: Failed to parse CRM Config configuration. Unknown attribute mpls_inseg_high_threshold.
Why I did it
To avoid CRM database being partially parsed when an unknown field is present.
How I verified it
Added an unknown field and check with the fix whether all fields are parsed.
Details if related