mbox series

[ovs-dev,RFC,0/9] Daemon mode for ovn-nbctl

Message ID 20180709185723.11349-1-jkbs@redhat.com
Headers show
Series Daemon mode for ovn-nbctl | expand

Message

Jakub Sitnicki July 9, 2018, 6:57 p.m. UTC
This series extends ovn-nbctl tool with support for the daemon mode, where
ovn-nbctl acts a long-lived process that accepts commands over a UNIX socket.
The daemon can be started the same way as any other OVS/OVN server:

  ovn-nbctl --detach --pidfile --log-file

While commands can be issued to it using the 'ovs-appctl' tool:

  ovs-appctl -t ovn-nbctl run [OPTIONS] COMMAND [-- [OPTIONS] COMMAND] ...

(Although the goal is to control the daemon using the ovn-nbctl program itself.)

The motivation and the main benefit from the daemon mode is that the contents of
NB database have to be obtained only once, when the first command is ran. On big
databases (1000's of logical ports) this results in a speed up per command in
the range of 100's of milliseconds.

The changes are functional to the point that all test cases in the ovn-nbctl
test suite (tests/ovn-nbctl.at) pass. Except for "ovn-nbctl - connection" test
case (see limitations below). Last patch in the series demonstrates it.

The shortcomings of current implementation are:

 - No support for commands that use tabular output, that is 'find' or 'list'
   (used by the mentioned failing test case).  'table' module prints formatted
   tables contents to standard output so it cannot be easily reused on the
   server side.

 - '--dry-run', '--wait', '--timeout' are unsupported. Although these options
   are understood, they will either take no effect or cause the daemon to
   malfunction.

 - Hitting an error path that calls ctl_fatal() to report an error will cause
   the daemon process to die. Use '--monitor' option as a workaround.

 - Documentation is missing.

Taking this into account, daemon mode should be considered experimental.

Very much looking forward to comments and feedback.

Thanks,
Jakub


Jakub Sitnicki (9):
  ovn-nbctl: Extract the main loop.
  ovn-nbctl: Pull up destroying commands from do_nbctl().
  ovn-nbctl: Pull up releasing IDL from do_nbctl().
  ovn-nbctl: Signal need to try again via an output param.
  ovn-nbctl: Don't dup the error message just to report it.
  ovn-nbctl: Propagate the error from do_nbctl().
  ovn-nbctl: Propagate errors from the main loop.
  ovn-nbctl: Initial support for daemon mode.
  WIP: tests: Integrate with ovn-nctl daemon mode.

 ovn/utilities/ovn-nbctl.c | 259 ++++++++++++++++++++++++++++++++++++++--------
 tests/ovn-nbctl.at        |  31 +++++-
 2 files changed, 248 insertions(+), 42 deletions(-)

--
2.14.4

Comments

Ben Pfaff July 9, 2018, 11:34 p.m. UTC | #1
On Mon, Jul 09, 2018 at 08:57:14PM +0200, Jakub Sitnicki wrote:
>  - No support for commands that use tabular output, that is 'find' or 'list'
>    (used by the mentioned failing test case).  'table' module prints formatted
>    tables contents to standard output so it cannot be easily reused on the
>    server side.

This is solvable:
        https://patchwork.ozlabs.org/patch/941734/
Ben Pfaff July 9, 2018, 11:51 p.m. UTC | #2
On Mon, Jul 09, 2018 at 08:57:14PM +0200, Jakub Sitnicki wrote:
> This series extends ovn-nbctl tool with support for the daemon mode, where
> ovn-nbctl acts a long-lived process that accepts commands over a UNIX socket.

Seems like a great start, I'll look forward to its evolution toward
being ready for final review.
Jakub Sitnicki July 10, 2018, 10:09 a.m. UTC | #3
On Mon, 9 Jul 2018 16:34:42 -0700
Ben Pfaff <blp@ovn.org> wrote:

> On Mon, Jul 09, 2018 at 08:57:14PM +0200, Jakub Sitnicki wrote:
> >  - No support for commands that use tabular output, that is 'find' or 'list'
> >    (used by the mentioned failing test case).  'table' module prints formatted
> >    tables contents to standard output so it cannot be easily reused on the
> >    server side.  
> 
> This is solvable:
>         https://patchwork.ozlabs.org/patch/941734/

Thank you. This is great.