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

[CRM]Handling Invalid CRM configuration gracefully #2109

Merged
merged 1 commit into from
Jan 12, 2022

Conversation

dgsudharsan
Copy link
Collaborator

@dgsudharsan dgsudharsan commented Jan 11, 2022

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

Signed-off-by: Sudharsan Dhamal Gopalarathnam <sudharsand@nvidia.com>
@dgsudharsan dgsudharsan changed the title Handling Invalid CRM configuration gracefully [CRM]Handling Invalid CRM configuration gracefully Jan 11, 2022
@prsunny prsunny merged commit b4b0003 into sonic-net:master Jan 12, 2022
judyjoseph pushed a commit that referenced this pull request Jan 17, 2022
*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.
Signed-off-by: Sudharsan Dhamal Gopalarathnam <sudharsand@nvidia.com>
qiluo-msft pushed a commit that referenced this pull request Jan 18, 2022
*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.
Signed-off-by: Sudharsan Dhamal Gopalarathnam <sudharsand@nvidia.com>
arlakshm pushed a commit that referenced this pull request Mar 1, 2022
*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.
Signed-off-by: Sudharsan Dhamal Gopalarathnam <sudharsand@nvidia.com>
preetham-singh pushed a commit to preetham-singh/sonic-swss that referenced this pull request Aug 6, 2022
*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.
Signed-off-by: Sudharsan Dhamal Gopalarathnam <sudharsand@nvidia.com>
@dgsudharsan dgsudharsan deleted the crm_fix branch March 9, 2023 02:01
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.

5 participants