Fix typo in config option name
[haproxy_amphora]/active_connection_rety_interval is renamed to active_connection_retry_interval. A config option with the typo still exists as a deprecated alias, so it doesn't break compatibility with old config files. Change-Id: Iafc479f1628fd3959c3f0ef83edb7a739823fb91
This commit is contained in:
@@ -267,7 +267,7 @@
|
|||||||
# be fully up and active. These values are lower than the other values to
|
# be fully up and active. These values are lower than the other values to
|
||||||
# facilitate "fail fast" scenarios like failovers
|
# facilitate "fail fast" scenarios like failovers
|
||||||
# active_connection_max_retries = 15
|
# active_connection_max_retries = 15
|
||||||
# active_connection_rety_interval = 2
|
# active_connection_retry_interval = 2
|
||||||
|
|
||||||
# These "failover" timeouts are used during the failover process to probe
|
# These "failover" timeouts are used during the failover process to probe
|
||||||
# amphorae that are part of the load balancer being failed over.
|
# amphorae that are part of the load balancer being failed over.
|
||||||
|
@@ -354,8 +354,9 @@ haproxy_amphora_opts = [
|
|||||||
cfg.IntOpt('active_connection_max_retries',
|
cfg.IntOpt('active_connection_max_retries',
|
||||||
default=15,
|
default=15,
|
||||||
help=_('Retry threshold for connecting to active amphorae.')),
|
help=_('Retry threshold for connecting to active amphorae.')),
|
||||||
cfg.IntOpt('active_connection_rety_interval',
|
cfg.IntOpt('active_connection_retry_interval',
|
||||||
default=2,
|
default=2,
|
||||||
|
deprecated_name='active_connection_rety_interval',
|
||||||
help=_('Retry timeout between connection attempts in '
|
help=_('Retry timeout between connection attempts in '
|
||||||
'seconds for active amphora.')),
|
'seconds for active amphora.')),
|
||||||
cfg.IntOpt('failover_connection_max_retries',
|
cfg.IntOpt('failover_connection_max_retries',
|
||||||
|
@@ -550,7 +550,7 @@ class AmphoraFlows(object):
|
|||||||
constants.CONN_MAX_RETRIES:
|
constants.CONN_MAX_RETRIES:
|
||||||
CONF.haproxy_amphora.active_connection_max_retries,
|
CONF.haproxy_amphora.active_connection_max_retries,
|
||||||
constants.CONN_RETRY_INTERVAL:
|
constants.CONN_RETRY_INTERVAL:
|
||||||
CONF.haproxy_amphora.active_connection_rety_interval}
|
CONF.haproxy_amphora.active_connection_retry_interval}
|
||||||
|
|
||||||
# Listeners update needs to be run on all amphora to update
|
# Listeners update needs to be run on all amphora to update
|
||||||
# their peer configurations. So parallelize this with an
|
# their peer configurations. So parallelize this with an
|
||||||
|
@@ -391,7 +391,7 @@ class LoadBalancerFlows(object):
|
|||||||
constants.CONN_MAX_RETRIES:
|
constants.CONN_MAX_RETRIES:
|
||||||
CONF.haproxy_amphora.active_connection_max_retries,
|
CONF.haproxy_amphora.active_connection_max_retries,
|
||||||
constants.CONN_RETRY_INTERVAL:
|
constants.CONN_RETRY_INTERVAL:
|
||||||
CONF.haproxy_amphora.active_connection_rety_interval}
|
CONF.haproxy_amphora.active_connection_retry_interval}
|
||||||
|
|
||||||
if failed_amp:
|
if failed_amp:
|
||||||
if failed_amp.role in (constants.ROLE_MASTER,
|
if failed_amp.role in (constants.ROLE_MASTER,
|
||||||
|
@@ -523,7 +523,7 @@ class AmphoraFlows(object):
|
|||||||
constants.CONN_MAX_RETRIES:
|
constants.CONN_MAX_RETRIES:
|
||||||
CONF.haproxy_amphora.active_connection_max_retries,
|
CONF.haproxy_amphora.active_connection_max_retries,
|
||||||
constants.CONN_RETRY_INTERVAL:
|
constants.CONN_RETRY_INTERVAL:
|
||||||
CONF.haproxy_amphora.active_connection_rety_interval}
|
CONF.haproxy_amphora.active_connection_retry_interval}
|
||||||
|
|
||||||
# Listeners update needs to be run on all amphora to update
|
# Listeners update needs to be run on all amphora to update
|
||||||
# their peer configurations. So parallelize this with an
|
# their peer configurations. So parallelize this with an
|
||||||
|
@@ -375,7 +375,7 @@ class LoadBalancerFlows(object):
|
|||||||
constants.CONN_MAX_RETRIES:
|
constants.CONN_MAX_RETRIES:
|
||||||
CONF.haproxy_amphora.active_connection_max_retries,
|
CONF.haproxy_amphora.active_connection_max_retries,
|
||||||
constants.CONN_RETRY_INTERVAL:
|
constants.CONN_RETRY_INTERVAL:
|
||||||
CONF.haproxy_amphora.active_connection_rety_interval}
|
CONF.haproxy_amphora.active_connection_retry_interval}
|
||||||
|
|
||||||
if failed_amp:
|
if failed_amp:
|
||||||
failed_amp_role = failed_amp.get(constants.ROLE)
|
failed_amp_role = failed_amp.get(constants.ROLE)
|
||||||
|
@@ -12,6 +12,8 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
|
import tempfile
|
||||||
|
|
||||||
from oslo_config import cfg
|
from oslo_config import cfg
|
||||||
from oslo_config import fixture as oslo_fixture
|
from oslo_config import fixture as oslo_fixture
|
||||||
|
|
||||||
@@ -49,3 +51,30 @@ class TestConfig(base.TestCase):
|
|||||||
self.assertRaises(
|
self.assertRaises(
|
||||||
ValueError, conf.config, group="certificates",
|
ValueError, conf.config, group="certificates",
|
||||||
server_certs_key_passphrase="insecure-key-do-not-u$e-this-key")
|
server_certs_key_passphrase="insecure-key-do-not-u$e-this-key")
|
||||||
|
|
||||||
|
def test_active_connection_retry_interval(self):
|
||||||
|
conf = self.useFixture(oslo_fixture.Config(config.cfg.CONF))
|
||||||
|
|
||||||
|
# Test new name
|
||||||
|
with tempfile.NamedTemporaryFile(mode='w', delete=True) as tmp:
|
||||||
|
tmp.write("[haproxy_amphora]\n"
|
||||||
|
"active_connection_retry_interval=4\n")
|
||||||
|
tmp.flush()
|
||||||
|
|
||||||
|
conf.set_config_files([tmp.name])
|
||||||
|
|
||||||
|
self.assertEqual(
|
||||||
|
4,
|
||||||
|
conf.conf.haproxy_amphora.active_connection_retry_interval)
|
||||||
|
|
||||||
|
# Test deprecated name
|
||||||
|
with tempfile.NamedTemporaryFile(mode='w', delete=True) as tmp:
|
||||||
|
tmp.write("[haproxy_amphora]\n"
|
||||||
|
"active_connection_rety_interval=3\n")
|
||||||
|
tmp.flush()
|
||||||
|
|
||||||
|
conf.set_config_files([tmp.name])
|
||||||
|
|
||||||
|
self.assertEqual(
|
||||||
|
3,
|
||||||
|
conf.conf.haproxy_amphora.active_connection_retry_interval)
|
||||||
|
@@ -74,7 +74,7 @@ class TestAmphoraDriverTasks(base.TestCase):
|
|||||||
conf.config(group="haproxy_amphora",
|
conf.config(group="haproxy_amphora",
|
||||||
active_connection_max_retries=CONN_MAX_RETRIES)
|
active_connection_max_retries=CONN_MAX_RETRIES)
|
||||||
conf.config(group="haproxy_amphora",
|
conf.config(group="haproxy_amphora",
|
||||||
active_connection_rety_interval=CONN_RETRY_INTERVAL)
|
active_connection_retry_interval=CONN_RETRY_INTERVAL)
|
||||||
conf.config(group="controller_worker",
|
conf.config(group="controller_worker",
|
||||||
loadbalancer_topology=constants.TOPOLOGY_SINGLE)
|
loadbalancer_topology=constants.TOPOLOGY_SINGLE)
|
||||||
self.timeout_dict = {constants.REQ_CONN_TIMEOUT: 1,
|
self.timeout_dict = {constants.REQ_CONN_TIMEOUT: 1,
|
||||||
|
@@ -79,7 +79,7 @@ class TestAmphoraDriverTasks(base.TestCase):
|
|||||||
conf.config(group="haproxy_amphora",
|
conf.config(group="haproxy_amphora",
|
||||||
active_connection_max_retries=CONN_MAX_RETRIES)
|
active_connection_max_retries=CONN_MAX_RETRIES)
|
||||||
conf.config(group="haproxy_amphora",
|
conf.config(group="haproxy_amphora",
|
||||||
active_connection_rety_interval=CONN_RETRY_INTERVAL)
|
active_connection_retry_interval=CONN_RETRY_INTERVAL)
|
||||||
conf.config(group="controller_worker",
|
conf.config(group="controller_worker",
|
||||||
loadbalancer_topology=constants.TOPOLOGY_SINGLE)
|
loadbalancer_topology=constants.TOPOLOGY_SINGLE)
|
||||||
self.timeout_dict = {constants.REQ_CONN_TIMEOUT: 1,
|
self.timeout_dict = {constants.REQ_CONN_TIMEOUT: 1,
|
||||||
|
@@ -0,0 +1,12 @@
|
|||||||
|
---
|
||||||
|
upgrade:
|
||||||
|
- |
|
||||||
|
The ``[haproxy_amphora].active_connection_rety_interval`` configuration
|
||||||
|
option has been renamed to
|
||||||
|
``[haproxy_amphora].active_connection_retry_interval``. An alias for the old
|
||||||
|
name is in place to maintain compatibility with old configuration files.
|
||||||
|
fixes:
|
||||||
|
- |
|
||||||
|
The ``[haproxy_amphora].active_connection_rety_interval`` configuration
|
||||||
|
option has been renamed to
|
||||||
|
``[haproxy_amphora].active_connection_retry_interval``.
|
Reference in New Issue
Block a user