-
Notifications
You must be signed in to change notification settings - Fork 665
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
[pbh]: Fix show PBH counters when cache is partial #3356
Conversation
Signed-off-by: Nazarii Hnydyn <[email protected]>
@qiluo-msft / @yxieca please help to review & merge |
@nazariig you mean that while the cache is not fully available the printed value will be 0? |
@liat-grozovik no. If no cache - print the actual counter value. This is a simple fix |
@nazariig the change looks in the good direction. However, from the description, I am not 100% sure if there could be a race condition where the record is not none and still only have partial information? Your current change only protected against the record is none scenario. Can you add a unit test? I am okay with moving forward with unit test since it is protecting a valid scenario. |
@yxieca done. Internal key partial information should be considered as a bug - traceback is expected |
Signed-off-by: Nazarii Hnydyn <[email protected]>
* [pbh]: Fix show PBH counters when cache is partial. Signed-off-by: Nazarii Hnydyn <[email protected]>
Cherry-pick PR to 202311: #3388 |
* [pbh]: Fix show PBH counters when cache is partial. Signed-off-by: Nazarii Hnydyn <[email protected]>
* [pbh]: Fix show PBH counters when cache is partial. Signed-off-by: Nazarii Hnydyn <[email protected]>
Cherry-pick PR to 202405: #3466 |
* [pbh]: Fix show PBH counters when cache is partial. Signed-off-by: Nazarii Hnydyn <[email protected]>
Signed-off-by: Nazarii Hnydyn [email protected]
During system init the initial snapshot of PBH rule counters doesn't contain all the necessary information, which makes a dump invalid. Thus, it fails CLI to do a comparison logic which prints a traceback. After some time, when counters are getting updated in the DB, the snapshot can be taken correctly and the issue is gone.
What I did
How I did it
How to verify it
sonic-clear pbh statistics
show pbh statistics
Previous command output (if the output of a command-line utility has changed)
New command output (if the output of a command-line utility has changed)