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

Let pfcwdmap creation fail gracefully #207

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

zbud-msft
Copy link
Contributor

@zbud-msft zbud-msft commented Mar 29, 2024

ADO: 27075747

Why I did it

There is a chance that PORT_QOS_MAP|global is used to fetc pfc_enable key, which will cause redis hget to fail and return err. All queries to counters_db will fail after that.

  • Fix that |global will not break redis hget
  • Failure to create pfcwd map will not impact COUNTERS_DB queries.

How I did it

Iterate and not use global as key for port_qos_map to check for pfc_enable

Any error creating pfcwd map will not stop future COUNTERS_DB queries

How to verify it

UT/Manual test. Tested in 202305

Which release branch to backport (provide reason below if selected)

  • 201811
  • 201911
  • 202006
  • 202012
  • 202106
  • 202111

Description for the changelog

Link to config_db schema for YANG module changes

A picture of a cute animal (not mandatory but encouraged)

@zbud-msft
Copy link
Contributor Author

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).


var qos_key string
for _, key := range resp {
if strings.Contains(key, "Ethernet") { // Account for PORT_QOS_MAP|global
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

global

could you just check "global" in the loop?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand this is to filter all key containing "Ethernet". However this prefix may be changed in future. Check not equal to "global" may be safer.

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.

4 participants