From: Ben Pfaff Date: Thu, 8 Mar 2012 18:49:47 +0000 (-0800) Subject: ovs-xapi-sync: Rerun processing when a db update arrives during a commit. X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;ds=sidebyside;h=6c6b6b3f627d108d97011ca0f919a4a804d9ddce;p=sliver-openvswitch.git ovs-xapi-sync: Rerun processing when a db update arrives during a commit. The logic in ovs-xapi-sync didn't handle the case where ovsdb-server sends a database update before it replies to a transaction that ovs-xapi-sync sent, like this: ovs-xapi-sync ovsdb-server ------------- ------------ . . . transaction request ---> <--- database contents update <--- transaction reply . . . The update was not lost but ovs-xapi-sync would not process it until the database changed again. Bug #10082. Reported-by: Krishna Miriyala Signed-off-by: Ben Pfaff --- diff --git a/xenserver/usr_share_openvswitch_scripts_ovs-xapi-sync b/xenserver/usr_share_openvswitch_scripts_ovs-xapi-sync index d5d6bb697..bc771d239 100755 --- a/xenserver/usr_share_openvswitch_scripts_ovs-xapi-sync +++ b/xenserver/usr_share_openvswitch_scripts_ovs-xapi-sync @@ -257,8 +257,10 @@ def main(): bridges = {} # Map from bridge name to xs_network_uuids iface_ids = {} # Map from xs-vif-uuid to iface-id + seqno = idl.change_seqno # Sequence number when we last processed the db while True: - if not force_run and not idl.run(): + idl.run() + if not force_run and seqno == idl.change_seqno: poller = ovs.poller.Poller() idl.wait(poller) poller.block() @@ -269,6 +271,7 @@ def main(): bridges = {} iface_ids = {} force_run = False + seqno = idl.change_seqno txn = ovs.db.idl.Transaction(idl)