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:15:02 +0000 (18:15 -0700)
commit783cd86f3c37b1b63280332f237115a90d1c773a
treebf5b766a8170d420525e09d04d40def091ece755
parent901252b48087862a755a04d2e71519194e1e7548
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