-
Notifications
You must be signed in to change notification settings - Fork 558
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
[CoPP] Fix the bug that copp configuration will cause failed logs during warm restart #2084
base: master
Are you sure you want to change the base?
Conversation
restart - What I do: Let CoppMgr skip configuration which are already in APPL_DB after warm restart. - Why I did it: After warm start, the CoppMgr will set configuration into APPL_DB which already exist, but this behavior is not necessary and it will cause CoPPorch to do a modification event. - How I verify it: With this enhancement, the syslog will not appear the error messages about Copp during a warm restart.
Can you please paste the error messages seen after warmboot here? |
|
@dgsudharsan , could you please check the latest comment? |
According to existing logic we delete the APP_DB will be cleared during an upgrade which includes warm-upgrade scenario. Without the APP_DB being set the feature wouldn't work during warm upgrades. Please check here |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please consider the warm upgrade scenario as requested.
@chaoskao Can you please explain the entire scenario. I tried with default copp configurations and I don't see any issues. Are you adding additional Copp configurations? |
@dgsudharsan The CoPP configuration shows as following |
I believe the usecase is swss warm-restart. Can you please check if warm-reboot itself is impacted? If swss warm-restart we may have to deal it differently. |
@dgsudharsan |
With your changes warmboot and warmupgrade will be broken. A suggestion would be to check if app_db is populated already and ignore setting app db. |
Do you means check the each attribute of CoPP rules from App_DB, if attribute already exist just ignore this attribute or just check the key of rules? |
You can check the key alone within warm restart check that you have introduced. You can use m_coppTable for this purpose. |
Looks like the change is impacting regular warmboot. As such, we cannot have this change merged. Can you please check on the options provided by @dgsudharsan. |
The modification is just for the warm-restart case which will set a "swss warm restart" flag in STATUS_DB. In the db_migratror case mentioned by @dgsudharsan, the enhancement will still apply the configuration from copp_cfg.json into APPL_DB because there is no entry in APPL_DB which is cleared in db_migrator. |
Have you tested this scenario? |
I try the warm start scenario and the test steps as following: on step 2, I check APPL_DB has been cleared, and after the step3 the entries of APPL_DB has been populated again Another warm reboot scenario has same result, the test steps as following: step 1. sudo config warm_restart enable swss |
If using db_migrator helps should we change sonic-mgmt test script rather than changing code here? |
Hi, @dgsudharsan |
I believe after using DB migrator you don't see the issue correct? If that's the case we need to use DB migrator logic in the test scripts to avoid the CoPP error logs. @prsunny what is your opinion on this? |
What I did
Let CoppMgr skip configuration which are already in APPL_DB after warm restart.
Why I did it
After warm start, the CoppMgr will set configuration into APPL_DB which already exist, but this behavior is not necessary and it will cause CoPPorch to do a modification event.
How I verified it
With this enhancement, the syslog will not appear the error messages about Copp during warm restart.
Details if related