Skip to content

fix error: interface counters is mismatch after warm-reboot#1099

Merged
yxieca merged 2 commits intosonic-net:masterfrom
JiangboHe:warm-reboot-counter
Nov 20, 2020
Merged

fix error: interface counters is mismatch after warm-reboot#1099
yxieca merged 2 commits intosonic-net:masterfrom
JiangboHe:warm-reboot-counter

Conversation

@JiangboHe
Copy link
Copy Markdown
Contributor

@JiangboHe JiangboHe commented Sep 8, 2020

- What I did
There is a issue for counters after warm-reboot:
If I clear counters by command "sonic-clear counters", then execute 'warm-reboot' and whenSONiC is restart, the counters showed with command "show interface counters" is still old counters before "sonic-clear". It is not the right counters because the counters file in '/tmp' is lost in warm-reboot process.

- How I did it
I fixed it by saving '/tmp/portstat-0' folders in '/host/' before executing 'warm-reboot', and restore the counters folders back to '/tmp/' after warm-reboot process is finished (in pull request sonic-net/sonic-buildimage#5346 ).

- How to verify it
Clear counters by command 'sonic-clear'
sonic-clear counters
sonic-clear dropcounters
sonic-clear pfccounters
sonic-clear queuecounters
sonic-clear rifcounters
Execute 'warm-reboot'
Use command ‘show interface counters’ to see if the counters is right.

- 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)

@JiangboHe
Copy link
Copy Markdown
Contributor Author

retest this please

1 similar comment
@JiangboHe
Copy link
Copy Markdown
Contributor Author

retest this please

@JiangboHe JiangboHe requested a review from yxieca November 17, 2020 06:18
@yxieca yxieca merged commit eb38aeb into sonic-net:master Nov 20, 2020
yxieca pushed a commit to sonic-net/sonic-buildimage that referenced this pull request Nov 20, 2020
- Why I did it
There is a issue for counters after warm-reboot:
If I clear counters by command "sonic-clear counters", then execute 'warm-reboot' and whenSONiC is restart, the counters showed with command "show interface counters" is still old counters before "sonic-clear". It is not the right counters because the counters file in '/tmp' is lost in warm-reboot process.

- How I did it
I fixed it by saving '/tmp/portstat-0' folders in '/host/' before executing 'warm-reboot' (in pull request sonic-net/sonic-utilities#1099 ), and restore the counters folders back to '/tmp/' after warm-reboot process is finished.

- How to verify it

Clear counters by command 'sonic-clear'
sonic-clear counters
sonic-clear dropcounters
sonic-clear pfccounters
sonic-clear queuecounters
sonic-clear rifcounters
Execute 'warm-reboot'
Use command ‘show interface counters’ to see if the counters is right.
@JiangboHe JiangboHe deleted the warm-reboot-counter branch November 24, 2020 02:11
santhosh-kt pushed a commit to santhosh-kt/sonic-buildimage that referenced this pull request Feb 25, 2021
…t#5346)

- Why I did it
There is a issue for counters after warm-reboot:
If I clear counters by command "sonic-clear counters", then execute 'warm-reboot' and whenSONiC is restart, the counters showed with command "show interface counters" is still old counters before "sonic-clear". It is not the right counters because the counters file in '/tmp' is lost in warm-reboot process.

- How I did it
I fixed it by saving '/tmp/portstat-0' folders in '/host/' before executing 'warm-reboot' (in pull request sonic-net/sonic-utilities#1099 ), and restore the counters folders back to '/tmp/' after warm-reboot process is finished.

- How to verify it

Clear counters by command 'sonic-clear'
sonic-clear counters
sonic-clear dropcounters
sonic-clear pfccounters
sonic-clear queuecounters
sonic-clear rifcounters
Execute 'warm-reboot'
Use command ‘show interface counters’ to see if the counters is right.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants