Add to save sai objects which are created during onPostPortCreate#994
Add to save sai objects which are created during onPostPortCreate#994gord1306 wants to merge 1 commit intosonic-net:masterfrom
Conversation
The ports which is without QUEUE related configurations still created related SCHEDULER_GROUPs in the onPostPortCreate() during the syncd startup in some platform - e.g. barefoot montara. But these created objects did NOT be recorded in the `COLDVIDS` and `m_warmBootDiscoveredVids` set. While swss is perform warmstart, the `compareViews()` would be called before apply the view, and it would detect the differences between the current view and temp view. Then syncd would remove these schedulers groups in the finalize. This patch adds to record the objects which are created during onPostPortCreate into the `m_warmBootDiscoveredVids` set.
|
|
||
| /* | ||
| * The ports which is without QUEUE related configurations still created | ||
| * related SCHEDULER_GROUPs in the onPostPortCreate() during the syncd | ||
| * startup in some platform - e.g. montara. But these created objects | ||
| * did NOT be recorded in the `COLDVIDS` and `m_warmBootDiscoveredVids` | ||
| * set. While swss is perform warmstart, the `compareViews()` would be | ||
| * called before apply the view, and it would detect the differences | ||
| * between the current view and temp view. Then syncd would remove these | ||
| * schedulers groups in the finalize. Therefore, add to record these | ||
| * object into the m_warmBootDiscoveredVids | ||
| */ | ||
| sai_object_id_t vid = m_translator->translateRidToVid(rid, m_switch_vid); | ||
| m_warmBootDiscoveredVids.insert(vid); |
There was a problem hiding this comment.
not sure why this is needed here, why m_warmBootDiscoveredVids is used at all, since onPostPortCreate is called AFTER cold boot or warm boot was performed already, so all discovered objects were already discovered during "create switch" at that phase. i dont quite understand description here, also you don't know whether onPostPortCreate which is called here is after cold boot or after warm boot, but yet you always add vids to m_warmBootDiscoveredVids
this translation is not needed here, if you are missing some vids, then it means problem is somewhere else
There was a problem hiding this comment.
Thanks for reply. The case that I encountered was to perform warmstart swss only, not syncd. And the onPostPortCreate() would not be called again. And it causes some vids which were created previous onPostPortCreate() would be miss, because there is no records for this vids. And in the ComparisonLogic::populateExistingObjects()ComparisonLogic.cpp#L2431, the logical looks like to handle this kind of objects, that why I put these vids in the m_warmBootDiscoveredVids.
The ports which is without QUEUE related configurations still created related
SCHEDULER_GROUPs in the onPostPortCreate() during the syncd startup in some
platform - e.g. barefoot montara. But these created objects did NOT be recorded
in the
COLDVIDSandm_warmBootDiscoveredVidsset. While swss is performwarmstart, the
compareViews()would be called before apply the view, and itwould detect the differences between the current view and temp view. Then syncd
would remove these schedulers groups in the finalize.
This patch adds to record the objects which are created during onPostPortCreate
into the
m_warmBootDiscoveredVidsset.Verified by
config warm_restart enable swssservice swss restartVerify the syslog is there any WARNING/ERR in
checkInternalObjects