bridge: Only complete daemonization after db commits initial config.
authorBen Pfaff <blp@nicira.com>
Wed, 10 Apr 2013 17:33:39 +0000 (10:33 -0700)
committerBen Pfaff <blp@nicira.com>
Thu, 11 Apr 2013 01:11:27 +0000 (18:11 -0700)
commit63ff04e82623e76521add85287b2ac0e1829bcfe
tree470c6aa1cfffa87627fe2f0fa1912ea76ddf73ec
parent0ffe45370d7fd3f78915b891557bd3e69eea2d05
bridge: Only complete daemonization after db commits initial config.

An earlier commit changed the Open vSwitch startup scripts so that they
connect to remote managers only after ovs-vswitchd does its initial
configuration, as signaled by ovs-vswitchd detaching from its parent
process.  However, a race window remains, because ovs-vswitchd detaching
does not mean that the database server has received and committed the
transaction, only that ovs-vswitchd has sent it.  This commit fixes that
race window, by changing ovs-vswitchd to complete detaching only after
the database server acknowledges the transaction.

It is still possible for unusual events to cause ovs-vswitchd to detach
before ephemeral columns are filled in.  There is always a slim possibility
that the transaction will fail or that some other client has added new
bridges, ports, etc. while ovs-vswitchd was configuring using an old
configuration.  The latter race is inherent to the design of the system
and cannot be avoided without radical changes.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ansis Atteka <aatteka@nicira.com>
Bug #15983.
vswitchd/bridge.c