Add support for ovn-ofctrl-wait-before-clear

Support was added for this option [1] to avoid dataplane downtime
during ovn upgrades where schema changes have happened. This
adds the ability for us to configure it.

[1] https://patchwork.ozlabs.org/project/ovn/patch/20220808182845.2746916-2-mmichels@redhat.com/

Change-Id: Ia3112b9a219b90af718c49776da49078449f09a2
(cherry picked from commit b5d38dcbd4)
This commit is contained in:
Terry Wilson 2022-11-01 12:45:15 -05:00 committed by Takashi Kajinami
parent dd79e895d1
commit a8f8fe2cec
3 changed files with 27 additions and 2 deletions

View File

@ -100,6 +100,11 @@
# (optional) Create ovs bridges according to ovn_bridge_mappings.
# Defaults to true
#
# [*ovn_ofctrl_wait_before_clear*]
# (optional) Time (ms) to wait at startup before clearing openflow rules and
# install new ones.
# Defaults to 8000
#
class ovn::controller(
$ovn_remote,
$ovn_encap_ip,
@ -119,7 +124,8 @@ class ovn::controller(
$enable_ovn_match_northd = false,
$ovn_chassis_mac_map = [],
$ovn_monitor_all = false,
$manage_ovs_bridge = true
$manage_ovs_bridge = true,
$ovn_ofctrl_wait_before_clear = 8000
) {
include ovn::params
@ -163,6 +169,7 @@ class ovn::controller(
'external_ids:ovn-remote-probe-interval' => { 'value' => $ovn_remote_probe_interval },
'external_ids:ovn-openflow-probe-interval' => { 'value' => $ovn_openflow_probe_interval },
'external_ids:ovn-monitor-all' => { 'value' => $ovn_monitor_all },
'external_ids:ovn-ofctrl-wait-before-clear' => { 'value' => $ovn_ofctrl_wait_before_clear },
}
if $ovn_cms_options {

View File

@ -0,0 +1,11 @@
---
features:
- |
The new ``ovn::controller::ovn_ofctrl_wait_before_clear`` parameter
has been added to resolve an issue with dataplane downtime during
upgrades that involve OVN schema changes. It will delay delting and
re-adding openflow rules by the configured time in ms to give
ovn-controller time to handle db connection / reconnection that can
happen in this case. The default of 8000ms is based on upstream OVN
testing with 200k openflow rules. Since it involved a change in
behavior, the upstream OVN value defaults to unset.

View File

@ -77,6 +77,9 @@ describe 'ovn::controller' do
is_expected.to contain_vs_config('external_ids:ovn-chassis-mac-mappings').with(
:ensure => 'absent'
)
is_expected.to contain_vs_config('external_ids:ovn-ofctrl-wait-before-clear').with(
:value => 8000
)
end
it 'configures bridge mappings' do
@ -102,7 +105,8 @@ describe 'ovn::controller' do
:ovn_transport_zones => ['tz1'],
:enable_ovn_match_northd => false,
:ovn_chassis_mac_map => ['physnet1:aa:bb:cc:dd:ee:ff',
'physnet2:bb:aa:cc:dd:ee:ff']
'physnet2:bb:aa:cc:dd:ee:ff'],
:ovn_ofctrl_wait_before_clear => 9000
})
end
@ -146,6 +150,9 @@ describe 'ovn::controller' do
is_expected.to contain_vs_config('external_ids:ovn-chassis-mac-mappings').with(
:value => 'physnet1:aa:bb:cc:dd:ee:ff,physnet2:bb:aa:cc:dd:ee:ff',
)
is_expected.to contain_vs_config('external_ids:ovn-ofctrl-wait-before-clear').with(
:value => params[:ovn_ofctrl_wait_before_clear],
)
end
it 'configures bridge mappings' do