Skip to content

Commit

Permalink
ovn-controller: Monitor chassis_private by chassis name.
Browse files Browse the repository at this point in the history
Remove the use of sbrec_chassis_is_new() for uncommitted records.  This
is not the way IDL *_is_new() functions are supposed to be used.

Note: With this change if the system-id changes there will be a
transient error in ovn-controller due to ovn-controller trying to insert
a new chassis_private record.  This is due to the fact that the view of
the chassis_private table changes and only chassis_private records
matching the new chassis name are sent to ovn-controller.  This gets
corrected though in the next iteration of the ovn-controller processing
loop.

Suggested-by: Han Zhou <hzhou@ovn.org>
Reported-at: https://mail.openvswitch.org/pipermail/ovs-dev/2020-October/376339.html
Fixes: dce1af3 ("chassis: Fix chassis_private record updates when the system-id changes.")
Signed-off-by: Dumitru Ceara <dceara@redhat.com>
Acked-by: Mark Gray <mark.d.gray@redhat.com>
Signed-off-by: Han Zhou <hzhou@ovn.org>
  • Loading branch information
dceara authored and hzhou8 committed Oct 20, 2020
1 parent 358d162 commit 1f915da
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions controller/ovn-controller.c
Expand Up @@ -181,7 +181,7 @@ update_sb_monitors(struct ovsdb_idl *ovnsb_idl,
* chassis */
sbrec_port_binding_add_clause_type(&pb, OVSDB_F_EQ, "chassisredirect");
sbrec_port_binding_add_clause_type(&pb, OVSDB_F_EQ, "external");
if (chassis && !sbrec_chassis_is_new(chassis)) {
if (chassis) {
/* This should be mostly redundant with the other clauses for port
* bindings, but it allows us to catch any ports that are assigned to
* us but should not be. That way, we can clear their chassis
Expand All @@ -205,8 +205,8 @@ update_sb_monitors(struct ovsdb_idl *ovnsb_idl,
&chassis->header_.uuid);

/* Monitors Chassis_Private record for current chassis only. */
sbrec_chassis_private_add_clause_chassis(&chprv, OVSDB_F_EQ,
&chassis->header_.uuid);
sbrec_chassis_private_add_clause_name(&chprv, OVSDB_F_EQ,
chassis->name);
} else {
/* During initialization, we monitor all records in Chassis_Private so
* that we don't try to recreate existing ones. */
Expand Down

0 comments on commit 1f915da

Please sign in to comment.