On Thu, Mar 19, 2015 at 12:08:30AM -0700, Andy Zhou wrote: > 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 <az...@nicira.com>
ovsdb_monitor_needs_flush() has a usage of ovs_assert() that's missing a ;. I was surprised that that compiles (it's because of the way that ovs_assert() is defined) but I'd still prefer to have the ;. Clang complains that the vlog module is defined without actually being used for anything: ../ovsdb/ovsdb-monitor.c:39:1: error: unused variable 'THIS_MODULE' [-Werror,-Wunused-const-variable] VLOG_DEFINE_THIS_MODULE(ovsdb_monitor); ^ ../include/openvswitch/vlog.h:181:42: note: expanded from macro 'VLOG_DEFINE_THIS_MODULE' static struct vlog_module *const THIS_MODULE = &VLM_##MODULE ^ 1 error generated. make[2]: *** [ovsdb/ovsdb_libovsdb_la-ovsdb-monitor.lo] Error 1 I guess that probably dates back a few commits. In struct ovsdb_monitor, s/commited/committed/ here: + uint64_t n_transactions; /* Count number of commited transactions. */ Acked-by: Ben Pfaff <b...@nicira.com> _______________________________________________ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev