Skip to content

Commit

Permalink
ovn-controller: Only set monitor conditions on available tables.
Browse files Browse the repository at this point in the history
Setting the monitor condition on a table that's not part of the SB
schema triggers an error from the server side, a downgrade to monitor v0
(from v2) and also causes the conditional monitoring sequence numbers to
go out of sync.

Use the <DB>rec_server_has_<TABLE>_table() API to determine if a table
is present in the server schema and therefore usable in the monitor
condition.

This commit also bumps the OVS submodule because the following fix is
needed:
  2410b95597fc ("ovsdb-cs: Consider default conditions implicitly acked.")

Reported-by: Numan Siddique <numans@ovn.org>
Reported-at: https://bugzilla.redhat.com/show_bug.cgi?id=2151063
Acked-by: Mark Michelson <mmichels@redhat.com>
Signed-off-by: Dumitru Ceara <dceara@redhat.com>
(cherry picked from commit 1b0dbde)
  • Loading branch information
dceara committed Dec 14, 2022
1 parent a82bb12 commit d73b641
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 11 deletions.
28 changes: 18 additions & 10 deletions controller/ovn-controller.c
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,14 @@ struct pending_pkt {
/* Registered ofctrl seqno type for nb_cfg propagation. */
static size_t ofctrl_seq_type_nb_cfg;

/* Only set monitor conditions on tables that are available in the
* server schema.
*/
#define sb_table_set_monitor_condition(idl, table, cond) \
(sbrec_server_has_##table##_table(idl) \
? sbrec_##table##_set_condition(idl, cond) \
: 0)

static unsigned int
update_sb_monitors(struct ovsdb_idl *ovnsb_idl,
const struct sbrec_chassis *chassis,
Expand Down Expand Up @@ -277,16 +285,16 @@ update_sb_monitors(struct ovsdb_idl *ovnsb_idl,

out:;
unsigned int cond_seqnos[] = {
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_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),
sb_table_set_monitor_condition(ovnsb_idl, port_binding, &pb),
sb_table_set_monitor_condition(ovnsb_idl, logical_flow, &lf),
sb_table_set_monitor_condition(ovnsb_idl, logical_dp_group, &ldpg),
sb_table_set_monitor_condition(ovnsb_idl, mac_binding, &mb),
sb_table_set_monitor_condition(ovnsb_idl, multicast_group, &mg),
sb_table_set_monitor_condition(ovnsb_idl, dns, &dns),
sb_table_set_monitor_condition(ovnsb_idl, controller_event, &ce),
sb_table_set_monitor_condition(ovnsb_idl, ip_multicast, &ip_mcast),
sb_table_set_monitor_condition(ovnsb_idl, igmp_group, &igmp),
sb_table_set_monitor_condition(ovnsb_idl, chassis_private, &chprv),
};

unsigned int expected_cond_seqno = 0;
Expand Down

0 comments on commit d73b641

Please sign in to comment.