Lower spacing time of the OVN maintenance tasks which should be run once
Some of the OVN maintenance tasks are expected to be run just once and
then they raise periodic.NeverAgain() to not be run anymore. Those tasks
also require to have acquried ovn db lock so that only one of the
maintenance workers really runs them.
All those tasks had set 600 seconds as a spacing time so they were run
every 600 seconds. This works fine usually but that may cause small
issue in the environments were Neutron is run in POD as k8s/openshift
application. In such case, when e.g. configuration of neutron is
updated, it may happen that first new POD with Neutron is spawned and
only once it is already running, k8s will stop old POD. Because of that
maintenance worker running in the new neutron-server POD will not
acquire lock on the OVN DB (old POD still holds the lock) and will not
run all those maintenance tasks immediately. After old POD will be
terminated, one of the new PODs will at some point acquire that lock and
then will run all those maintenance tasks but this would cause 600
seconds delay in running them.
To avoid such long waiting time to run those maintenance tasks, this
patch lowers its spacing time from 600 to just 5 seconds.
Additionally maintenance tasks which are supposed to be run only once and
only by the maintenance worker which has acquired ovn db lock will now be
stopped (periodic.NeverAgain will be raised) after 100 attempts of
run.
This will avoid running them every 5 seconds forever on the workers
which don't acquire lock on the OVN DB at all.
Reviewed: https:/ /review. opendev. org/c/openstack /neutron/ +/925710 /opendev. org/openstack/ neutron/ commit/ 910821805907a18 00d0dd875e9af41 352c80cf5a
Committed: https:/
Submitter: "Zuul (22348)"
Branch: stable/2023.2
commit 910821805907a18 00d0dd875e9af41 352c80cf5a
Author: Slawek Kaplonski <email address hidden>
Date: Tue Jul 30 14:17:44 2024 +0200
Lower spacing time of the OVN maintenance tasks which should be run once
Some of the OVN maintenance tasks are expected to be run just once and NeverAgain( ) to not be run anymore. Those tasks
then they raise periodic.
also require to have acquried ovn db lock so that only one of the
maintenance workers really runs them.
All those tasks had set 600 seconds as a spacing time so they were run
every 600 seconds. This works fine usually but that may cause small
issue in the environments were Neutron is run in POD as k8s/openshift
application. In such case, when e.g. configuration of neutron is
updated, it may happen that first new POD with Neutron is spawned and
only once it is already running, k8s will stop old POD. Because of that
maintenance worker running in the new neutron-server POD will not
acquire lock on the OVN DB (old POD still holds the lock) and will not
run all those maintenance tasks immediately. After old POD will be
terminated, one of the new PODs will at some point acquire that lock and
then will run all those maintenance tasks but this would cause 600
seconds delay in running them.
To avoid such long waiting time to run those maintenance tasks, this NeverAgain will be raised) after 100 attempts of
patch lowers its spacing time from 600 to just 5 seconds.
Additionally maintenance tasks which are supposed to be run only once and
only by the maintenance worker which has acquired ovn db lock will now be
stopped (periodic.
run.
This will avoid running them every 5 seconds forever on the workers
which don't acquire lock on the OVN DB at all.
Conflicts:
neutron/ plugins/ ml2/drivers/ ovn/mech_ driver/ ovsdb/maintenan ce.py
neutron/ tests/unit/ plugins/ ml2/drivers/ ovn/mech_ driver/ ovsdb/test_ maintenance. py
Closes-bug: #2074209 a5da27a5d313f75 b5bd23805b2 d52a60121b6f862 36ba6e26ee) 9f974531bbf61ce 5c8e852770)
Change-Id: Iabb4bb427588c1
(cherry picked from commit 04c217bcd0eda07
(cherry picked from commit 78900c12f3c398b