This repository was archived by the owner on Aug 31, 2022. It is now read-only.
Open
Conversation
Accidentally included
Changing from PFC_WD_TABLE to PFC_WD
hui-ma
reviewed
Aug 15, 2020
Collaborator
hui-ma
left a comment
There was a problem hiding this comment.
Please do a cleaning round. Thansk!
| return | ||
| } | ||
| cs.cMu.Unlock() | ||
| log.V(7).Infof("Before switch 346 %v", cs) |
| if clientCfg.TLS != nil { | ||
| opts = append(opts, grpc.WithTransportCredentials(credentials.NewTLS(clientCfg.TLS))) | ||
| } else { | ||
| opts = append(opts, grpc.WithInsecure()) |
Collaborator
There was a problem hiding this comment.
This should not belong to the PR
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Changes made to virtual_db.go to fix the Pfcwd redis data path. I fixed the table name, updated the count used to get port number accordingly, and added if statment to filter out smaller keys like PFC_WD|Global.
Based on the current code in the Sonic-telemetry repo, the original expected path for the PFC_WD keys was PFC_WD_TABLE: https://github.com/Azure/sonic-telemetry/blob/master/sonic_data_client/virtual_db.go#L133. This change was made back when warm boot support was added to SONiC-swss-common, the table name for Pfcwd was changed from PFC_WD_TABLE to PFC_WD. So this changed caused the COUNTERS/Ethernet*/Pfcwd command to look for the ports listed with the PFC_WD_TABLE key which always returned nothing given that it no longer exists. Changing the length then caused line 147 (https://github.com/Azure/sonic-telemetry/blob/master/sonic_data_client/virtual_db.go#L147) to fail to get the proper port number from the keys because the removing the first 14 characters parsed to et## instead of the intended ##.