[ovs-dev] [PATCH v2] ovn: Take advantage of OVSDB garbage collection in OVN_Northbound schema.

Justin Pettit jpettit at nicira.com
Thu Jul 2 22:48:32 UTC 2015


> On Jul 2, 2015, at 10:51 AM, Ben Pfaff <blp at nicira.com> wrote:
> 
> Until now, the OVN_Northbound schema has been designed to sidestep a
> weakness in the OVSDB protocol when a column has a great deal of data in
> it.  In the current OVSDB protocol, whenever a column changes, the entire
> new value of the column is sent to all of the clients that are monitoring
> that column.  That means that adding or removing a small amount of data,
> say 1 element in a set, requires sending all of the data, which is
> expensive if the column has a lot of data.
> 
> ...
> 
> This commit will break the Neutron integration until that is changed to
> handle the new database schema.

Thanks for a great commit message.  And this is a nice improvement, too.

> +/* Removes lport 'lswitch->ports[idx]'. */
> +static void
> +remove_lport(const struct nbrec_logical_switch *lswitch, size_t idx)
> +{
> +    const struct nbrec_logical_port *lport = lswitch->ports[idx];
> +
> +    /* First remove 'lport' from the array of ports.  This is what will
> +     * actually causing the logical port to be deleted when the transaction is

s/causing/cause/

> +     * sent to the database server (due to garbage collection). */
> +    struct nbrec_logical_port **new_ports
> +        = xmemdup(lswitch->ports, sizeof *new_ports * lswitch->n_ports);
> +    new_ports[idx] = new_ports[lswitch->n_ports - 1];
> +    nbrec_logical_switch_verify_ports(lswitch);
> +    nbrec_logical_switch_set_ports(lswitch, new_ports, lswitch->n_ports + 1);

Shouldn't this be "- 1" instead of "+ 1"?

Otherwise:

Acked-by: Justin Pettit <jpettit at nicira.com>

--Justin





More information about the dev mailing list