@@ -6888,6 +6888,36 @@ void checkAsicVsDatabaseConsistency(
6888
6888
}
6889
6889
}
6890
6890
6891
+ void checkMap (
6892
+ _In_ const ObjectIdMap& firstR2V,
6893
+ _In_ const char * firstR2Vname,
6894
+ _In_ const ObjectIdMap& firstV2R,
6895
+ _In_ const char * firstV2Rname,
6896
+ _In_ const ObjectIdMap& secondR2V,
6897
+ _In_ const char * secondR2Vname,
6898
+ _In_ const ObjectIdMap& secondV2R,
6899
+ _In_ const char *secondV2Rname)
6900
+ {
6901
+ SWSS_LOG_ENTER ();
6902
+
6903
+ for (auto it: firstR2V)
6904
+ {
6905
+ sai_object_id_t r = it.first ;
6906
+ sai_object_id_t v = it.second ;
6907
+
6908
+ if (firstV2R.find (v) == firstV2R.end ())
6909
+ SWSS_LOG_ERROR (" %s (0x%lx:0x%lx) is missing from %s" , firstR2Vname, r, v, firstV2Rname);
6910
+ else if (firstV2R.at (v) != r)
6911
+ SWSS_LOG_ERROR (" mismatch on %s (0x%lx:0x%lx) vs %s (0x%lx:0x%lx)" , firstR2Vname, r, v, firstV2Rname, v, firstV2R.at (v));
6912
+
6913
+ if (secondR2V.find (r) == secondR2V.end ())
6914
+ SWSS_LOG_ERROR (" %s (0x%lx:0x%lx) is missing from %s" , firstR2Vname, r, v, secondR2Vname);
6915
+ else if (secondV2R.find (secondR2V.at (r)) == secondV2R.end ())
6916
+ SWSS_LOG_ERROR (" %s (0x%lx:0x%lx) is missing from %s" , firstR2Vname, r, secondR2V.at (r), secondV2Rname);
6917
+ }
6918
+ }
6919
+
6920
+
6891
6921
sai_status_t syncdApplyView ()
6892
6922
{
6893
6923
SWSS_LOG_ENTER ();
@@ -7053,9 +7083,12 @@ sai_status_t syncdApplyView()
7053
7083
(current.vidToRid .size () != temp.vidToRid .size ()))
7054
7084
{
7055
7085
/*
7056
- * TODO for debug we need to display differences
7086
+ * Check all possible differences.
7057
7087
*/
7058
7088
7089
+ checkMap (current.ridToVid , " current R2V" , current.vidToRid , " current V2R" , temp.ridToVid , " temp R2V" , temp.vidToRid , " temp V2R" );
7090
+ checkMap (temp.ridToVid , " temp R2V" , temp.vidToRid , " temp V2R" , current.ridToVid , " current R2V" , current.vidToRid , " current V2R" );
7091
+
7059
7092
SWSS_LOG_THROW (" wrong number of vid/rid items in map, forgot to translate? R2V: %zu:%zu, V2R: %zu:%zu, FIXME" ,
7060
7093
current.ridToVid .size (),
7061
7094
temp.ridToVid .size (),
0 commit comments