It has been observed that when we upgrade openvswitch with
thousands of openflow flows already established and there is heavy
traffic going through the switch, restoring flows can take a very
long time (8 minutes in one use case) with CPU running at 100%.
This can make the upgrade very expensive.
This commit starts vswitchd by asking it to wait till flow restore is
finished. Once the flows are restored, it resumes normal operations.
Bug #16086.
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
action "Restoring ofport values" "${script_ofports}"
}
action "Restoring ofport values" "${script_ofports}"
}
+flow_restore_wait () {
+ ovs_vsctl set open_vswitch . other_config:flow-restore-wait="true"
+}
+
+flow_restore_complete () {
+ ovs_vsctl --if-exists remove open_vswitch . other_config \
+ flow-restore-wait="true"
+}
+
restore_flows () {
[ -x "${script_flows}" ] && \
action "Restoring saved flows" "${script_flows}"
restore_flows () {
[ -x "${script_flows}" ] && \
action "Restoring saved flows" "${script_flows}"
action "Removing openvswitch module" rmmod openvswitch
fi
action "Removing openvswitch module" rmmod openvswitch
fi
+ # Start vswitchd by asking it to wait till flow restore is finished.
+ flow_restore_wait
+ # Restore saved flows and inform vswitchd that we are done.
add_managers
restore_interfaces
add_managers
restore_interfaces
restore_ofports
stop_forwarding
restore_ofports
stop_forwarding
+
+ # Start vswitchd by asking it to wait till flow restore is finished.
+ flow_restore_wait
- # Restore the saved flows.
+ # Restore saved flows and inform vswitchd that we are done.
add_managers
# Restore the interfaces if required. Return true even if restore fails.
add_managers
# Restore the interfaces if required. Return true even if restore fails.
to <code>false</code> (or remove it entirely from the database).
</li>
</ol>
to <code>false</code> (or remove it entirely from the database).
</li>
</ol>
+ <p>
+ The <code>ovs-ctl</code>'s ``restart'' and ``force-reload-kmod''
+ functions use the above config option during hot upgrades.
+ </p>