On Thu, Sep 08, 2011 at 06:59:46PM -0700, Ethan Jackson wrote: > This patch no longer rate limits database updates due to CFM > changes. Due to recent changes, the fault status of CFM only > changes once per 3.5 tx_interval seconds. There doesn't seem to be > a good reason to add an additional rate limit on top of this.
This patch changes bridge_run() to commit a database transaction on every trip through the main loop. That's going be troublesome because of how transactions work. A transaction is always constructed against the last version of the database contents received from ovsdb-server. Calling ovsdb_idl_txn_commit() sends the transaction to ovsdb-server and *does a rollback* of the changes from ovs-vswitchd's in-memory copy of the database. Only when ovsdb-server commit succeeds or fails and ovsdb-server sends the updated version of the database will the in-memory copy of the database be permanently updated. This means that, if it takes more than one trip through the main loop for ovsdb-server to update the database and send back the updated version, then, with this patch, ovs-vswitchd will send an extra copy of the updates on every trip. I think that the solution is to keep the transaction around until the commit finishes, something like this: if (!txn) { txn = ovsdb_idl_txn_create(idl); HMAP_FOR_EACH (br, node, &all_bridges) { struct iface *iface; HMAP_FOR_EACH (iface, name_node, &br->iface_by_name) { iface_refresh_cfm_stats(iface); } } } if (ovsdb_idl_txn_commit(txn) != TXN_INCOMPLETE) { ovsdb_idl_txn_destroy(txn); txn = NULL; } 'txn' needs to be static now so probably a longer name is better. We'd also need an ovsdb_idl_txn_wait() call in bridge_wait(). _______________________________________________ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev