@@ -122,9 +122,11 @@ void ComparisonLogic::compareViews()
122
122
123
123
applyViewTransition (current, temp);
124
124
125
+ transferNotProcessed (current, temp);
126
+
125
127
// TODO have a method to check for not processed objects
126
128
// and maybe add them to list on processing attributes
127
- // and move note processed objects to temporay view as well
129
+ // and move note processed objects to temporary view as well
128
130
// we need to check oid attributes as well
129
131
130
132
SWSS_LOG_NOTICE (" ASIC operations to execute: %zu" , current.asicGetOperationsCount ());
@@ -1635,6 +1637,21 @@ bool ComparisonLogic::performObjectSetTransition(
1635
1637
meta->attridname ,
1636
1638
currentAttr->getStrAttrValue ().c_str ());
1637
1639
1640
+ // don't produce too much noise for queues
1641
+ if (currentAttr->getStrAttrId () != " SAI_QUEUE_ATTR_TYPE" )
1642
+ {
1643
+ SWSS_LOG_WARN (" current attr is CREATE_ONLY and object is MATCHED: %s transferring %s:%s to temp object" ,
1644
+ currentBestMatch->m_str_object_id .c_str (),
1645
+ meta->attridname ,
1646
+ currentAttr->getStrAttrValue ().c_str ());
1647
+ }
1648
+
1649
+ std::shared_ptr<SaiAttr> transferedAttr = std::make_shared<SaiAttr>(
1650
+ currentAttr->getStrAttrId (),
1651
+ currentAttr->getStrAttrValue ());
1652
+
1653
+ temporaryObj->setAttr (transferedAttr);
1654
+
1638
1655
continue ;
1639
1656
}
1640
1657
}
@@ -2803,6 +2820,79 @@ void ComparisonLogic::createPreMatchMap(
2803
2820
count);
2804
2821
}
2805
2822
2823
+ void ComparisonLogic::transferNotProcessed (
2824
+ _In_ AsicView& current,
2825
+ _In_ AsicView& temp)
2826
+ {
2827
+ SWSS_LOG_ENTER ();
2828
+
2829
+ SWSS_LOG_NOTICE (" calling transferNotProcessed" );
2830
+
2831
+ /*
2832
+ * It may happen that after performing view transition, some objects will
2833
+ * not be processed. This may happen is scenario where buffer pool is
2834
+ * assigned to buffer profile, and then buffer profile is assigned to
2835
+ * queue. If OA will query only for oid for that buffer profile, then
2836
+ * buffer pool will not be processed. Normally if it would be removed by
2837
+ * comparison logic. More on this issue can be found on github:
2838
+ * https://github.com/Azure/sonic-sairedis/issues/899
2839
+ *
2840
+ * So what we will do, we will transfer all not processed objects to
2841
+ * temporary view with the same RID and VID. If nothing will happen to them,
2842
+ * they will stay there until next warm boot where they will be removed.
2843
+ */
2844
+
2845
+ /*
2846
+ * We need a loop (or recursion) since not processed objects may have oid
2847
+ * attributes as well.
2848
+ */
2849
+
2850
+ while (current.getAllNotProcessedObjects ().size ())
2851
+ {
2852
+ SWSS_LOG_WARN (" we have %zu not processed objects on current view, moving to temp view" , current.getAllNotProcessedObjects ().size ());
2853
+
2854
+ for (const auto & obj: current.getAllNotProcessedObjects ())
2855
+ {
2856
+ auto vid = obj->getVid ();
2857
+
2858
+ auto rid = current.m_vidToRid .at (vid);
2859
+
2860
+ /*
2861
+ * We should have only oid objects here, since all non oid objects
2862
+ * are leafs in graph and has been removed.
2863
+ */
2864
+
2865
+ auto tmp = temp.createDummyExistingObject (rid, vid);
2866
+
2867
+ /*
2868
+ * Move both objects to matched state since match oids was already
2869
+ * called, and here we created some new objects that should be matched.
2870
+ */
2871
+
2872
+ current.m_oOids .at (vid)->setObjectStatus (SAI_OBJECT_STATUS_FINAL);
2873
+ temp.m_oOids .at (vid)->setObjectStatus (SAI_OBJECT_STATUS_FINAL);
2874
+
2875
+ SWSS_LOG_WARN (" moved %s VID %s RID %s to temporary view, and marked FINAL" ,
2876
+ obj->m_str_object_type .c_str (),
2877
+ obj->m_str_object_id .c_str (),
2878
+ sai_serialize_object_id (rid).c_str ());
2879
+
2880
+ for (auto & kvp: obj->getAllAttributes ())
2881
+ {
2882
+ auto & sh = kvp.second ;
2883
+
2884
+ auto attr = std::make_shared<SaiAttr>(sh->getStrAttrId (), sh->getStrAttrValue ());
2885
+
2886
+ tmp->setAttr (attr);
2887
+
2888
+ SWSS_LOG_WARN (" * with attr: %s: %s" ,
2889
+ sh->getStrAttrId ().c_str (),
2890
+ sh->getStrAttrValue ().c_str ());
2891
+ }
2892
+
2893
+ }
2894
+ }
2895
+ }
2806
2896
2807
2897
void ComparisonLogic::applyViewTransition (
2808
2898
_In_ AsicView ¤t,
0 commit comments