[ovs-git] [ovn-org/ovn] 7888c0: ovn-northd-ddlog: Apply multiple database updates ...

Ben Pfaff noreply at github.com
Fri Mar 26 20:46:56 UTC 2021


  Branch: refs/heads/master
  Home:   https://github.com/ovn-org/ovn
  Commit: 7888c0831bfbd989fe373b9915b0b4361720e7fd
      https://github.com/ovn-org/ovn/commit/7888c0831bfbd989fe373b9915b0b4361720e7fd
  Author: Ben Pfaff <blp at ovn.org>
  Date:   2021-03-26 (Fri, 26 Mar 2021)

  Changed paths:
    M northd/ovn-northd-ddlog.c

  Log Message:
  -----------
  ovn-northd-ddlog: Apply multiple database updates in single ddlog txn.

DDlog can apply a larger batch of updates more efficiently than a series
of smaller ones.  Until now, ovn-northd-ddlog has always applied updates
one-by-one.  This commit changes it so that if multiple updates are
received in a batch, it applies all of them within a single ddlog
transaction.

Signed-off-by: Ben Pfaff <blp at ovn.org>
Acked-by: Numan Siddique <numans at ovn.org>


  Commit: d0d0a2d513159dc145dd251c51023bbf69505dc4
      https://github.com/ovn-org/ovn/commit/d0d0a2d513159dc145dd251c51023bbf69505dc4
  Author: Ben Pfaff <blp at ovn.org>
  Date:   2021-03-26 (Fri, 26 Mar 2021)

  Changed paths:
    M northd/ovn_northd.dl

  Log Message:
  -----------
  ovn-northd-ddlog: Make NB and SB DNS records have different UUIDs.

It's unexpected for different records in different databases to have
the same UUID, so make them different.

Signed-off-by: Ben Pfaff <blp at ovn.org>
Acked-by: Numan Siddique <numans at ovn.org>


  Commit: 5488df0fae0e7cf78e36998feeac8b8f5fe90b12
      https://github.com/ovn-org/ovn/commit/5488df0fae0e7cf78e36998feeac8b8f5fe90b12
  Author: Ben Pfaff <blp at ovn.org>
  Date:   2021-03-26 (Fri, 26 Mar 2021)

  Changed paths:
    M northd/ovn_northd.dl

  Log Message:
  -----------
  ovn-northd-ddlog: Improve type safety for datapath stages.

Until now, whether a logical flow stage was for a logical router or
switch, whether it was ingress or egress, and what particular stage it
was were each separate attributes.  It was possible to create an
invalid stage, e.g. a "logical router" stage that was actually present
only in logical switches.  This would result in a bug.

This commit makes such bugs much harder to cause.  They will generally
become compile-time errors.

This code refactoring shouldn't change ovn-northd-ddlog behavior.

Signed-off-by: Ben Pfaff <blp at ovn.org>
Acked-by: Numan Siddique <numans at ovn.org>


  Commit: 7bafb7902f9d6a9339743bffb780794bbd149145
      https://github.com/ovn-org/ovn/commit/7bafb7902f9d6a9339743bffb780794bbd149145
  Author: Ben Pfaff <blp at ovn.org>
  Date:   2021-03-26 (Fri, 26 Mar 2021)

  Changed paths:
    M northd/ipam.dl
    M northd/lrouter.dl
    M northd/lswitch.dl
    M northd/ovn_northd.dl

  Log Message:
  -----------
  ovn-northd-ddlog: Use object form of is_some(), drop is_none().

DDlog supports a couple different forms of functions.  You can write
is_some(expr) or expr.is_some(), for example.  The latter is usually
easier to understand, especially in bigger expressions.  It was
introduced later so it's not consistently used in ovn-northd-ddlog.
This commit switches to the object-like form throughout the code.

Writing is_none(expr) or expr.is_none() is equivalent to writing
expr == None.  I think that the latter is easier to understand, so
this commit also makes that change throughout.

This code refactoring shouldn't change ovn-northd-ddlog behavior.

Signed-off-by: Ben Pfaff <blp at ovn.org>
Acked-by: Numan Siddique <numans at ovn.org>


  Commit: ae7359628b4f9f44514435581a1c81e3037eed8f
      https://github.com/ovn-org/ovn/commit/ae7359628b4f9f44514435581a1c81e3037eed8f
  Author: Ben Pfaff <blp at ovn.org>
  Date:   2021-03-26 (Fri, 26 Mar 2021)

  Changed paths:
    M northd/helpers.dl
    M northd/lrouter.dl
    M northd/lswitch.dl
    M northd/multicast.dl
    M northd/ovn_northd.dl

  Log Message:
  -----------
  ovn-northd-ddlog: Make map_get_*() more object-like.

These functions were introduced before the object-like invocation
form was added to DDlog.  It's usually easier to read the object-like
form, so this changes the functions to this form and updates all the
callers.

It seemed to me that map_get_int_def_limit() was more general if we
just introduced a general-purpose clamp() function, so I did that.

This code refactoring shouldn't change ovn-northd-ddlog behavior.

Signed-off-by: Ben Pfaff <blp at ovn.org>
Acked-by: Numan Siddique <numans at ovn.org>


  Commit: d110394ca239c056c24ca3e871cdd74b8a92c90f
      https://github.com/ovn-org/ovn/commit/d110394ca239c056c24ca3e871cdd74b8a92c90f
  Author: Ben Pfaff <blp at ovn.org>
  Date:   2021-03-26 (Fri, 26 Mar 2021)

  Changed paths:
    M northd/automake.mk
    A northd/bitwise.dl
    A northd/bitwise.rs
    M northd/ovn.dl
    M northd/ovn.rs

  Log Message:
  -----------
  ovn-northd-ddlog: Add general-purpose bitwise library.

This should really go into upstream ddlog, but it's OK here for
the moment.

Signed-off-by: Ben Pfaff <blp at ovn.org>
Acked-by: Numan Siddique <numans at ovn.org>


  Commit: f8134b2f6f1d1630acd7df3f6ceb79af906d7939
      https://github.com/ovn-org/ovn/commit/f8134b2f6f1d1630acd7df3f6ceb79af906d7939
  Author: Ben Pfaff <blp at ovn.org>
  Date:   2021-03-26 (Fri, 26 Mar 2021)

  Changed paths:
    M northd/ipam.dl
    M northd/lrouter.dl
    M northd/lswitch.dl
    M northd/multicast.dl
    M northd/ovn.dl
    M northd/ovn.rs
    M northd/ovn_northd.dl

  Log Message:
  -----------
  ovn-northd-ddlog: Define in_addr, in6_addr, eth_addr in ddlog code.

All of these were defined as opaque "extern" types in the ddlog code.
I have found that they are easier to work with and understand if
the ddlog code can look into their implementations.  This commit
re-defines them in terms of proper ddlog types.  It also renames
many of the functions that operate on them so that they can be used
in an object-like form, as well as defining many of these functions
in ddlog code rather than as externs.

This code refactoring shouldn't change ovn-northd-ddlog behavior.

Signed-off-by: Ben Pfaff <blp at ovn.org>
Acked-by: Numan Siddique <numans at ovn.org>


  Commit: 331b1506963a2fd6f815074a8957f7a9a4038ecb
      https://github.com/ovn-org/ovn/commit/331b1506963a2fd6f815074a8957f7a9a4038ecb
  Author: Ben Pfaff <blp at ovn.org>
  Date:   2021-03-26 (Fri, 26 Mar 2021)

  Changed paths:
    M northd/lrouter.dl

  Log Message:
  -----------
  ovn-northd-ddlog: Avoid N*M crossproduct joining switches with routers.

DDlog takes a literalist view of joins, executing them in the order that
are written without attempting much in the way of reordering or
optimization.  The FirstHopLogicalRouter rule as written here joined
LogicalRouterPort with LogicalSwitchPort without using any join key,
and then later eliminated some of the possibilities.  This meant that
if there were N router ports and M switch ports, DDlog actually
considered all N*M possibilities, which is expensive.

This commit improves the big-O of the situation by introducing an
intermediate table that contains only the switch port that connect to
router ports and by giving that table a column that can be used as a
join key.  This allows DDlog to join them efficiently.  (The new column
is needed because DDlog cannot join on a member of a map directly.)

Found via the DDlog profiling feature:
https://github.com/vmware/differential-datalog/blob/master/doc/tutorial/tutorial.md#Profiling

Suggested-by: Mihai Budiu <mbudiu at vmware.com>
Suggested-by: Leonid Ryhzyk <lryzhyk at vmware.com>
Signed-off-by: Ben Pfaff <blp at ovn.org>
Acked-by: Numan Siddique <numans at ovn.org>


  Commit: 7c1ae20c87242ed52ff8e2d8b1eef667f478f4f8
      https://github.com/ovn-org/ovn/commit/7c1ae20c87242ed52ff8e2d8b1eef667f478f4f8
  Author: Ben Pfaff <blp at ovn.org>
  Date:   2021-03-26 (Fri, 26 Mar 2021)

  Changed paths:
    M northd/lrouter.dl

  Log Message:
  -----------
  ovn-northd-ddlog: Rephrase RouterStaticRoute rule.

I found that this slightly increased performance when there are lots
of routers, probably because there's less data copying.

Signed-off-by: Ben Pfaff <blp at ovn.org>
Acked-by: Numan Siddique <numans at ovn.org>


Compare: https://github.com/ovn-org/ovn/compare/b725f5903c59...7c1ae20c8724


More information about the git mailing list