diff options
author | Ben Pfaff <blp@nicira.com> | 2012-03-08 10:49:47 -0800 |
---|---|---|
committer | Ben Pfaff <blp@nicira.com> | 2012-03-08 11:42:25 -0800 |
commit | a8a4d9565ba652b2f610ffad4e78d1f9068248ad (patch) | |
tree | f3f14b595ef409ffcbe8740c43656d6869ce2f73 /xenserver | |
parent | 6a6455e5cea4b87df8073026ec961f11efe2a541 (diff) |
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 <krishna@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Diffstat (limited to 'xenserver')
-rwxr-xr-x | xenserver/usr_share_openvswitch_scripts_ovs-xapi-sync | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/xenserver/usr_share_openvswitch_scripts_ovs-xapi-sync b/xenserver/usr_share_openvswitch_scripts_ovs-xapi-sync index 7132726a..0ffccc2d 100755 --- a/xenserver/usr_share_openvswitch_scripts_ovs-xapi-sync +++ b/xenserver/usr_share_openvswitch_scripts_ovs-xapi-sync @@ -272,8 +272,10 @@ def main(): bridges = {} # Map from bridge name to xs_network_uuids iface_ids = {} # Map from xs-vif-uuid to iface-id vm_ids = {} # Map from xs-vm-uuid to vm-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() @@ -285,6 +287,7 @@ def main(): iface_ids = {} vm_ids = {} force_run = False + seqno = idl.change_seqno txn = ovs.db.idl.Transaction(idl) |