[ovs-git] [openvswitch/ovs] c005fd: ovsdb-test: add multiple clients to backlogged con...

GitHub noreply at github.com
Sat May 30 00:44:04 UTC 2015


  Branch: refs/heads/master
  Home:   https://github.com/openvswitch/ovs
  Commit: c005fd6147ce3ffc310aa9811352d10bf7a831cb
      https://github.com/openvswitch/ovs/commit/c005fd6147ce3ffc310aa9811352d10bf7a831cb
  Author: Andy Zhou <azhou at nicira.com>
  Date:   2015-05-29 (Fri, 29 May 2015)

  Changed paths:
    M tests/ovsdb-server.at

  Log Message:
  -----------
  ovsdb-test: add multiple clients to backlogged connection test

Backlogged connection test tests jsonrpc monitor's ability to combine
updates. Adding multiple clients to ensure that non-blocking clients
will get individual updates while blocking clients will get combined
updates.

Signed-off-by: Andy Zhou <azhou at nicira.com>
Acked-by: Ben Pfaff <blp at nicira.com>


  Commit: 897af58755f3f75c880642171239caa98530e4ad
      https://github.com/openvswitch/ovs/commit/897af58755f3f75c880642171239caa98530e4ad
  Author: Andy Zhou <azhou at nicira.com>
  Date:   2015-05-29 (Fri, 29 May 2015)

  Changed paths:
    M ovsdb/jsonrpc-server.c

  Log Message:
  -----------
  jsonrpc-server: split monitors into database back end and JSON-RPC front
end

jsonrpc-server.c has two main functions. One deals with handling the
jsonrpc connections, the other deals with monitoring the database.

Currently, each jsonrpc connections has its own set of DB monitors.
This can be wasteful if a number of connections shares the same
monitors.

This patch, and a few following refactoring patches attempts to
split the jsonrpc handling front end off the main monitoring
functions within jsonrpc.c.

This patch changes the monitoring functions and data structures from
'ovsdb_jsonrpc_monitor_xxx' into 'ovsdb_monitor_xxx'

This and the following patches move the ovsdb_monitor backend functions
into their own file.

Signed-off-by: Andy Zhou <azhou at nicira.com>
Acked-by: Ben Pfaff <blp at nicira.com>


  Commit: f3395ab3226b29b6e5460706b066189a40983595
      https://github.com/openvswitch/ovs/commit/f3395ab3226b29b6e5460706b066189a40983595
  Author: Andy Zhou <azhou at nicira.com>
  Date:   2015-05-29 (Fri, 29 May 2015)

  Changed paths:
    M ovsdb/jsonrpc-server.c

  Log Message:
  -----------
  jsonrpc-server: make setting mt->select into its own functions

To make ovsdb_monitor an opaque to ovsdb_jsonrpc server object.

Signed-off-by: Andy Zhou <azhou at nicira.com>
Acked-by: Ben Pfaff <blp at nicira.com>


  Commit: 83d300f6afecf29d63938b55265a74f5563a315d
      https://github.com/openvswitch/ovs/commit/83d300f6afecf29d63938b55265a74f5563a315d
  Author: Andy Zhou <azhou at nicira.com>
  Date:   2015-05-29 (Fri, 29 May 2015)

  Changed paths:
    M ovsdb/jsonrpc-server.c

  Log Message:
  -----------
  jsonrpc-server: refactor ovsdb_jsonrpc_parse_monitor_request

Change ovsdb_jsonrpc_parse_monitor_request() to make
ovsdb_monitor_table an opaque object.

Signed-off-by: Andy Zhou <azhou at nicira.com>
Acked-by: Ben Pfaff <blp at nicira.com>


  Commit: ea585a0e24f0d31ee593091045a4c6d008aba231
      https://github.com/openvswitch/ovs/commit/ea585a0e24f0d31ee593091045a4c6d008aba231
  Author: Andy Zhou <azhou at nicira.com>
  Date:   2015-05-29 (Fri, 29 May 2015)

  Changed paths:
    M ovsdb/jsonrpc-server.c

  Log Message:
  -----------
  jsonrpc-server: refactor ovsdb_monitor_add_column()

To hide ovsdb_monitor_table object from ovsdb_jsonrpc serve.

Signed-off-by: Andy Zhou <azhou at nicira.com>
Acked-by: Ben Pfaff <blp at nicira.com>


  Commit: 92d5d643898fd8b9ea6503f9286351747e681c15
      https://github.com/openvswitch/ovs/commit/92d5d643898fd8b9ea6503f9286351747e681c15
  Author: Andy Zhou <azhou at nicira.com>
  Date:   2015-05-29 (Fri, 29 May 2015)

  Changed paths:
    M ovsdb/jsonrpc-server.c

  Log Message:
  -----------
  jsonrpc-server: refactoring ovsdb_jsonrpc_monitor_compose_table_update()

Now it simply calls ovsdb_monitor_compose_table_update(), which
actually creates the json object.

Signed-off-by: Andy Zhou <azhou at nicira.com>
Acked-by: Ben Pfaff <blp at nicira.com>


  Commit: dbc1cfbb2818b4ead18716d41e452a1b0742c70e
      https://github.com/openvswitch/ovs/commit/dbc1cfbb2818b4ead18716d41e452a1b0742c70e
  Author: Andy Zhou <azhou at nicira.com>
  Date:   2015-05-29 (Fri, 29 May 2015)

  Changed paths:
    M ovsdb/jsonrpc-server.c

  Log Message:
  -----------
  jsonrpc-server: refactoring ovsdb_jsonrpc_monitor_needs_flush

split out per monitoring needs_flush() into
ovsdb_monitor_needs_flush().

Signed-off-by: Andy Zhou <azhou at nicira.com>
Acked-by: Ben Pfaff <blp at nicira.com>


  Commit: 51df26a68e709f357d4ee24eebfba1aacb758eb9
      https://github.com/openvswitch/ovs/commit/51df26a68e709f357d4ee24eebfba1aacb758eb9
  Author: Andy Zhou <azhou at nicira.com>
  Date:   2015-05-29 (Fri, 29 May 2015)

  Changed paths:
    M ovsdb/jsonrpc-server.c

  Log Message:
  -----------
  jsonrpc-server: rename ovsdb_jsonrpc_monitor_get_initial()

rename ovsdb_jsonrpc_monitor_get_initial() to
ovsdb_monitor_get_initial()

Signed-off-by: Andy Zhou <azhou at nicira.com>
Acked-by: Ben Pfaff <blp at nicira.com>


  Commit: 88b633082c0de646bebf1966bd06299692e4f9ba
      https://github.com/openvswitch/ovs/commit/88b633082c0de646bebf1966bd06299692e4f9ba
  Author: Andy Zhou <azhou at nicira.com>
  Date:   2015-05-29 (Fri, 29 May 2015)

  Changed paths:
    M ovsdb/jsonrpc-server.c

  Log Message:
  -----------
  jsonrpc-server: refactoring ovsdb_monitor_destroy()

Add ovsdb_monitor_destroy() function to properly cleanup ovsdb_monitor.
It is also responsible for unhook from the replica chain.

The replica destroy callback is now called
ovsdb_monitor_destroy_callback()

Minor variable renaming in ovsdb_monitor_create() to make it
more consistent.

Signed-off-by: Andy Zhou <azhou at nicira.com>
Acked-by: Ben Pfaff <blp at nicira.com>


  Commit: 2fa1df7b88611f8858882147b5db122c5644799c
      https://github.com/openvswitch/ovs/commit/2fa1df7b88611f8858882147b5db122c5644799c
  Author: Andy Zhou <azhou at nicira.com>
  Date:   2015-05-29 (Fri, 29 May 2015)

  Changed paths:
    M ovsdb/automake.mk
    M ovsdb/jsonrpc-server.c
    M ovsdb/jsonrpc-server.h
    A ovsdb/monitor.c
    A ovsdb/monitor.h

  Log Message:
  -----------
  jsonrpc-server: Split out monitor backend functions to monitor.c/h

Added new files monitor.[ch] for monitor backend functions.
There is no functional changes.

Signed-off-by: Andy Zhou <azhou at nicira.com>
Acked-by: Ben Pfaff <blp at nicira.com>


  Commit: 61b63013e6074478d264d20c2db0edf17e57a0ff
      https://github.com/openvswitch/ovs/commit/61b63013e6074478d264d20c2db0edf17e57a0ff
  Author: Andy Zhou <azhou at nicira.com>
  Date:   2015-05-29 (Fri, 29 May 2015)

  Changed paths:
    M ovsdb/jsonrpc-server.c
    M ovsdb/monitor.c
    M ovsdb/monitor.h

  Log Message:
  -----------
  ovsdb-monitor: refactoring ovsdb_monitor_get_initial

Refactoring ovsdb_monitor_get_initial() to not generate JSON object.
It only collect changes within the ovsdb_monitor().
ovsdb_jsonrpc_monitor_compose_table_update() is then used to generate
JSON object.

This change will also make future patch easier.

Signed-off-by: Andy Zhou <azhou at nicira.com>
Acked-by: Ben Pfaff <blp at nicira.com>


  Commit: d941283758dffb8471b13469c75f3512e0df6417
      https://github.com/openvswitch/ovs/commit/d941283758dffb8471b13469c75f3512e0df6417
  Author: Andy Zhou <azhou at nicira.com>
  Date:   2015-05-29 (Fri, 29 May 2015)

  Changed paths:
    M ovsdb/jsonrpc-server.c
    M ovsdb/monitor.c
    M ovsdb/monitor.h

  Log Message:
  -----------
  ovsdb-monitor: stores jsonrpc-monitor in a linked-list

Currently, each ovsdb-monitor points to a single jsonrpc_monitor object.
This means there is 1:1 relationship between them.

In case multiple jsonrpc-monitors need to monitor the same tables and
the columns within them, then can share a single ovsdb-monitor, so the
updates only needs to be maintained once.

This patch, with a few following patches,  will allow for N:1 mapping
between jsonrpc-monitor and ovsdb-monitor.

Maintaining jsonrpc-monitor pointers in a linked-list is essential
in allowing N:1 mapping. The ovsdb-monitor life cycle
is now reference counted. An empty list means zero references.

Signed-off-by: Andy Zhou <azhou at nicira.com>
Acked-by: Ben Pfaff <blp at nicira.com>


  Commit: 59c35e1198ee42887649297bb4fd8687c5005ac8
      https://github.com/openvswitch/ovs/commit/59c35e1198ee42887649297bb4fd8687c5005ac8
  Author: Andy Zhou <azhou at nicira.com>
  Date:   2015-05-29 (Fri, 29 May 2015)

  Changed paths:
    M ovsdb/jsonrpc-server.c
    M ovsdb/monitor.c
    M ovsdb/monitor.h

  Log Message:
  -----------
  ovsdb-monitor: add transaction ids

With N:1 mappings, multiple jsonrpc server may be servicing the rpc
connection at a different pace. ovsdb-monitor thus needs to maintain
different change sets, depends on connection speed of each rpc
connections. Connections servicing at the same speed can share the
same change set.

Transaction ID is an concept added to describe the change set. One
possible view of the database state is a sequence of changes, more
precisely, commits be applied to it in order, starting from an
initial state, with commit 0. The logic can also be applied to the
jsonrpc monitor; each change it pushes corresponds to commits between
two transaction IDs.

This patch introduces transaction IDs. For ovsdb-monitor, it maintains
n_transactions, starting from 0. Each commit add 1 to the number.
Jsonrpc maintains and 'unflushed' transaction number, corresponding to
the next commit the remote has not seen. jsonrpc's job is simply to
notice there are changes in the ovsdb-monitor that it is interested in,
i.e.  'n_transactions' >= 'unflushed', get the changes in json format,
and push them to the remote site.

Signed-off-by: Andy Zhou <azhou at nicira.com>
Acked-by: Ben Pfaff <blp at nicira.com>


  Commit: f1de87bb2f568ad126e77e85746ce63376ff0bd5
      https://github.com/openvswitch/ovs/commit/f1de87bb2f568ad126e77e85746ce63376ff0bd5
  Author: Andy Zhou <azhou at nicira.com>
  Date:   2015-05-29 (Fri, 29 May 2015)

  Changed paths:
    M ovsdb/jsonrpc-server.c
    M ovsdb/monitor.c
    M ovsdb/monitor.h

  Log Message:
  -----------
  ovsdb-monitor: rename jsonrpc_monitor_compose_table_update()

jsonrpc_monitor_compose_update() seems to fit better than
jsonrpc_monitor_compose_table_update(), since it composes changes
from all tables.  Albeit the original one is named after the
<table-updates> object described in RFC 7047.

Signed-off-by: Andy Zhou <azhou at nicira.com>
Acked-by: Ben Pfaff <blp at nicira.com>


Compare: https://github.com/openvswitch/ovs/compare/6f17821ed39b...f1de87bb2f56


More information about the git mailing list