Always use sb_table_set_req_mon_condition macro in update_sb_monitors
routine even for optional tables (e.g. advertised_mac_binding or
advertised_route) since OvS IDL layer will take care of creating proper
monitor requests according to the real db schema.
This patch fixes the conditional monitor support for optional tables
since sb_table_set_opt_mon_condition macro will not properly enable
conditional monitoring until we run update_sb_monitors() in the
ovn-controller main loop. As result we will always receive notifications
for all the columns of optional tables (even if monitor-all is not enabled)
until we modify a monitor conditions.

Reported-at: https://issues.redhat.com/browse/FDP-3114
Signed-off-by: Lorenzo Bianconi <[email protected]>
---
 controller/ovn-controller.c | 41 +++++++++++++++----------------------
 1 file changed, 16 insertions(+), 25 deletions(-)

diff --git a/controller/ovn-controller.c b/controller/ovn-controller.c
index 7e6c9e69a..06736395b 100644
--- a/controller/ovn-controller.c
+++ b/controller/ovn-controller.c
@@ -215,15 +215,7 @@ static char *get_file_system_id(void)
     free(filename);
     return ret;
 }
-/* Only set monitor conditions on tables that are available in the
- * server schema.
- */
-#define sb_table_set_opt_mon_condition(idl, table, cond) \
-    (sbrec_server_has_##table##_table(idl)               \
-     ? sbrec_##table##_set_condition(idl, cond)          \
-     : 0)
 
-/* Assume the table exists in the server schema and set its condition. */
 #define sb_table_set_req_mon_condition(idl, table, cond) \
     sbrec_##table##_set_condition(idl, cond)
 
@@ -423,23 +415,22 @@ update_sb_monitors(struct ovsdb_idl *ovnsb_idl,
 
 out:;
     unsigned int cond_seqnos[] = {
-        sb_table_set_req_mon_condition(ovnsb_idl, port_binding, &pb),
-        sb_table_set_req_mon_condition(ovnsb_idl, logical_flow, &lf),
-        sb_table_set_req_mon_condition(ovnsb_idl, logical_dp_group, &ldpg),
-        sb_table_set_req_mon_condition(ovnsb_idl, mac_binding, &mb),
-        sb_table_set_req_mon_condition(ovnsb_idl, fdb, &fdb),
-        sb_table_set_req_mon_condition(ovnsb_idl, multicast_group, &mg),
-        sb_table_set_req_mon_condition(ovnsb_idl, dns, &dns),
-        sb_table_set_req_mon_condition(ovnsb_idl, controller_event, &ce),
-        sb_table_set_req_mon_condition(ovnsb_idl, ip_multicast, &ip_mcast),
-        sb_table_set_req_mon_condition(ovnsb_idl, igmp_group, &igmp),
-        sb_table_set_req_mon_condition(ovnsb_idl, chassis_private, &chprv),
-        sb_table_set_opt_mon_condition(ovnsb_idl, chassis_template_var, &tv),
-        sb_table_set_opt_mon_condition(ovnsb_idl, ecmp_nexthop, &nh),
-        sb_table_set_opt_mon_condition(ovnsb_idl, advertised_route, &ar),
-        sb_table_set_opt_mon_condition(ovnsb_idl, learned_route, &lr),
-        sb_table_set_opt_mon_condition(ovnsb_idl, advertised_mac_binding,
-                                       &amb),
+        sbrec_port_binding_set_condition(ovnsb_idl, &pb),
+        sbrec_logical_flow_set_condition(ovnsb_idl, &lf),
+        sbrec_logical_dp_group_set_condition(ovnsb_idl, &ldpg),
+        sbrec_mac_binding_set_condition(ovnsb_idl, &mb),
+        sbrec_fdb_set_condition(ovnsb_idl, &fdb),
+        sbrec_multicast_group_set_condition(ovnsb_idl, &mg),
+        sbrec_dns_set_condition(ovnsb_idl, &dns),
+        sbrec_controller_event_set_condition(ovnsb_idl, &ce),
+        sbrec_ip_multicast_set_condition(ovnsb_idl, &ip_mcast),
+        sbrec_igmp_group_set_condition(ovnsb_idl, &igmp),
+        sbrec_chassis_private_set_condition(ovnsb_idl, &chprv),
+        sbrec_chassis_template_var_set_condition(ovnsb_idl, &tv),
+        sbrec_ecmp_nexthop_set_condition(ovnsb_idl, &nh),
+        sbrec_advertised_route_set_condition(ovnsb_idl, &ar),
+        sbrec_learned_route_set_condition(ovnsb_idl, &lr),
+        sbrec_advertised_mac_binding_set_condition(ovnsb_idl, &amb),
     };
 
     unsigned int expected_cond_seqno = 0;
-- 
2.54.0

_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to