Previously, the force-reload-kmod command would stop forwarding, stop
the database, restart the database, and then restart forwarding. If the
database is large, it can take a while to be read (we've seen as much as
10 seconds), which means the switch is not forwarding traffic during
that time.
This change stops and starts the database before restarting the
forwarding path. This means that ovs-vswitchd will lose its
connectivity to the database during a force-reload-kmod, but while it
will complain a little in the logs, it will continue to operate
properly.
Signed-off-by: Justin Pettit <jpettit@nicira.com>
Feature #12643
action "Configuring Open vSwitch system IDs" "$@" $extra_ids
}
action "Configuring Open vSwitch system IDs" "$@" $extra_ids
}
if test X"$FORCE_COREFILES" = Xyes; then
ulimit -Sc 67108864
fi
if test X"$FORCE_COREFILES" = Xyes; then
ulimit -Sc 67108864
fi
- insert_mod_if_required || return 1
+start_ovsdb () {
+ check_force_cores
if daemon_is_running ovsdb-server; then
log_success_msg "ovsdb-server is already running"
if daemon_is_running ovsdb-server; then
log_success_msg "ovsdb-server is already running"
+}
+
+start_forwarding () {
+ check_force_cores
+
+ insert_mod_if_required || return 1
if daemon_is_running ovs-vswitchd; then
log_success_msg "ovs-vswitchd is already running"
if daemon_is_running ovs-vswitchd; then
log_success_msg "ovs-vswitchd is already running"
+stop_ovsdb () {
+ stop_daemon ovsdb-server
+}
+
+stop_forwarding () {
stop_daemon ovs-brcompatd
stop_daemon ovs-vswitchd
stop_daemon ovs-brcompatd
stop_daemon ovs-vswitchd
- stop_daemon ovsdb-server
}
## ----------------- ##
}
## ----------------- ##
ifaces=`internal_interfaces`
action "Detected internal interfaces: $ifaces" true
ifaces=`internal_interfaces`
action "Detected internal interfaces: $ifaces" true
+ # Restart the database first, since a large database may take a
+ # while to load, and we want to minimize forwarding disruption.
+ stop_ovsdb
+ start_ovsdb
+
+ stop_forwarding
script=`mktemp`
trap 'rm -f "$script"' 0 1 2 13 15
script=`mktemp`
trap 'rm -f "$script"' 0 1 2 13 15
:
else
log_warning_msg "Failed to save configuration, not replacing kernel module"
:
else
log_warning_msg "Failed to save configuration, not replacing kernel module"
exit 1
fi
chmod +x "$script"
exit 1
fi
chmod +x "$script"
action "Removing openvswitch module" rmmod openvswitch
fi
action "Removing openvswitch module" rmmod openvswitch
fi
action "Restoring interface configuration" "$script"
rc=$?
action "Restoring interface configuration" "$script"
rc=$?
done
case $command in
start)
done
case $command in
start)
+ start_ovsdb
+ start_forwarding
+ stop_forwarding
+ stop_ovsdb