From 24eb676cb354e4bf8b608b4fd7db2c3c18d07d2a Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Fri, 12 Jan 2024 13:11:23 +0900 Subject: [PATCH] Support (api_)db_commit_retry parameters Recent octavia provides the [haproxy_amphora] api_db_commit_retry_* options[1] and the [controller_worker] db_commit_retry_* options[2]. [1] 955bb8840616d96ed74de3086f8959ad4190a472 [2] be91493332786365b8e997fcf88779a12d1ae130 Change-Id: I0d749b65ee3069cc04ae040997f47c097f24d4c6 --- manifests/controller.pp | 48 +++++++++++++++++++ .../db-commit-retries-6143ddb798d0c1c7.yaml | 5 ++ spec/classes/octavia_controller_spec.rb | 24 ++++++++++ 3 files changed, 77 insertions(+) create mode 100644 releasenotes/notes/db-commit-retries-6143ddb798d0c1c7.yaml diff --git a/manifests/controller.pp b/manifests/controller.pp index 74f5e7e8..c4c184c3 100644 --- a/manifests/controller.pp +++ b/manifests/controller.pp @@ -82,6 +82,22 @@ # (optional) Enable octavia event notifications. # Defaults to $facts['os_service_default'] # +# [*db_commit_retry_attempts*] +# (optional) The number of times the database action will be attempted. +# Defaults to $facts['os_service_default'] +# +# [*db_commit_retry_initial_delay*] +# (optional) The time to backoff retry attempt. +# Defaults to $facts['os_service_default'] +# +# [*db_commit_retry_backoff*] +# (optional) Tie time to backoff retry attempts. +# Defaults to $facts['os_service_default'] +# +# [*db_commit_retry_max*] +# (optional) The maximum amount of time to wait between retry attempts. +# Defaults to $facts['os_service_default'] +# # [*amp_ssh_key_name*] # (optional) Name of Openstack SSH keypair for communicating with amphora # Defaults to 'octavia-ssh-key' @@ -152,6 +168,22 @@ # (optional) Retry timeout between build attempts in seconds. # Defaults to $facts['os_service_default'] # +# [*api_db_commit_retry_attempts*] +# (optional) The number of times the database action will be attempted. +# Defaults to $facts['os_service_default'] +# +# [*api_db_commit_retry_initial_delay*] +# (optional) The time to backoff retry attempt. +# Defaults to $facts['os_service_default'] +# +# [*api_db_commit_retry_backoff*] +# (optional) Tie time to backoff retry attempts. +# Defaults to $facts['os_service_default'] +# +# [*api_db_commit_retry_max*] +# (optional) The maximum amount of time to wait between retry attempts. +# Defaults to $facts['os_service_default'] +# # [*default_connection_limit*] # (optional) Default connection_limit for listeners. # Defaults to $facts['os_service_default'] @@ -274,6 +306,10 @@ class octavia::controller ( $amphora_delete_retries = $facts['os_service_default'], $amphora_delete_retry_interval = $facts['os_service_default'], $event_notifications = $facts['os_service_default'], + $db_commit_retry_attempts = $facts['os_service_default'], + $db_commit_retry_initial_delay = $facts['os_service_default'], + $db_commit_retry_backoff = $facts['os_service_default'], + $db_commit_retry_max = $facts['os_service_default'], Boolean $enable_ssh_access = true, String[1] $amp_ssh_key_name = 'octavia-ssh-key', $timeout_client_data = $facts['os_service_default'], @@ -290,6 +326,10 @@ class octavia::controller ( $build_rate_limit = $facts['os_service_default'], $build_active_retries = $facts['os_service_default'], $build_retry_interval = $facts['os_service_default'], + $api_db_commit_retry_attempts = $facts['os_service_default'], + $api_db_commit_retry_initial_delay = $facts['os_service_default'], + $api_db_commit_retry_backoff = $facts['os_service_default'], + $api_db_commit_retry_max = $facts['os_service_default'], $default_connection_limit = $facts['os_service_default'], $agent_request_read_timeout = $facts['os_service_default'], $agent_tls_protocol = $facts['os_service_default'], @@ -348,6 +388,10 @@ class octavia::controller ( 'controller_worker/amphora_delete_retries' : value => $amphora_delete_retries; 'controller_worker/amphora_delete_retry_interval' : value => $amphora_delete_retry_interval; 'controller_worker/event_notifications' : value => $event_notifications; + 'controller_worker/db_commit_retry_attempts' : value => $db_commit_retry_attempts; + 'controller_worker/db_commit_retry_initial_delay' : value => $db_commit_retry_initial_delay; + 'controller_worker/db_commit_retry_backoff' : value => $db_commit_retry_backoff; + 'controller_worker/db_commit_retry_max' : value => $db_commit_retry_max; 'haproxy_amphora/timeout_client_data' : value => $timeout_client_data; 'haproxy_amphora/timeout_member_connect' : value => $timeout_member_connect; 'haproxy_amphora/timeout_member_data' : value => $timeout_member_data; @@ -362,6 +406,10 @@ class octavia::controller ( 'haproxy_amphora/build_rate_limit' : value => $build_rate_limit; 'haproxy_amphora/build_active_retries' : value => $build_active_retries; 'haproxy_amphora/build_retry_interval' : value => $build_retry_interval; + 'haproxy_amphora/api_db_commit_retry_attempts' : value => $api_db_commit_retry_attempts; + 'haproxy_amphora/api_db_commit_retry_initial_delay' : value => $api_db_commit_retry_initial_delay; + 'haproxy_amphora/api_db_commit_retry_backoff' : value => $api_db_commit_retry_backoff; + 'haproxy_amphora/api_db_commit_retry_max' : value => $api_db_commit_retry_max; 'haproxy_amphora/default_connection_limit' : value => $default_connection_limit; 'amphora_agent/agent_request_read_timeout' : value => $agent_request_read_timeout; 'amphora_agent/agent_tls_protocol' : value => $agent_tls_protocol; diff --git a/releasenotes/notes/db-commit-retries-6143ddb798d0c1c7.yaml b/releasenotes/notes/db-commit-retries-6143ddb798d0c1c7.yaml new file mode 100644 index 00000000..e95653ba --- /dev/null +++ b/releasenotes/notes/db-commit-retries-6143ddb798d0c1c7.yaml @@ -0,0 +1,5 @@ +--- +features: + - | + The ``octavia::controller`` class now supports the tunable parameters to + customize database coomit retry attempts. diff --git a/spec/classes/octavia_controller_spec.rb b/spec/classes/octavia_controller_spec.rb index 66998aef..569c51c2 100644 --- a/spec/classes/octavia_controller_spec.rb +++ b/spec/classes/octavia_controller_spec.rb @@ -38,6 +38,10 @@ describe 'octavia::controller' do :amphora_delete_retries => 5, :amphora_delete_retry_interval => 5, :event_notifications => true, + :db_commit_retry_attempts => 2000, + :db_commit_retry_initial_delay => 1, + :db_commit_retry_backoff => 1, + :db_commit_retry_max => 5, :timeout_client_data => 60, :timeout_member_connect => 5, :timeout_member_data => 60, @@ -51,6 +55,10 @@ describe 'octavia::controller' do :build_rate_limit => 10, :build_active_retries => 120, :build_retry_interval => 5, + :api_db_commit_retry_attempts => 15, + :api_db_commit_retry_initial_delay => 1, + :api_db_commit_retry_backoff => 1, + :api_db_commit_retry_max => 5, :default_connection_limit => 50000, :agent_request_read_timeout => 180, :agent_tls_protocol => 'TLSv1.2', @@ -96,6 +104,10 @@ describe 'octavia::controller' do is_expected.to contain_octavia_config('controller_worker/amphora_delete_retries').with_value(5) is_expected.to contain_octavia_config('controller_worker/amphora_delete_retry_interval').with_value(5) is_expected.to contain_octavia_config('controller_worker/event_notifications').with_value(true) + is_expected.to contain_octavia_config('controller_worker/db_commit_retry_attempts').with_value(2000) + is_expected.to contain_octavia_config('controller_worker/db_commit_retry_initial_delay').with_value(1) + is_expected.to contain_octavia_config('controller_worker/db_commit_retry_backoff').with_value(1) + is_expected.to contain_octavia_config('controller_worker/db_commit_retry_max').with_value(5) is_expected.to contain_octavia_config('haproxy_amphora/timeout_client_data').with_value(60) is_expected.to contain_octavia_config('haproxy_amphora/timeout_member_connect').with_value(5) is_expected.to contain_octavia_config('haproxy_amphora/timeout_member_data').with_value(60) @@ -109,6 +121,10 @@ describe 'octavia::controller' do is_expected.to contain_octavia_config('haproxy_amphora/build_rate_limit').with_value(10) is_expected.to contain_octavia_config('haproxy_amphora/build_active_retries').with_value(120) is_expected.to contain_octavia_config('haproxy_amphora/build_retry_interval').with_value(5) + is_expected.to contain_octavia_config('haproxy_amphora/api_db_commit_retry_attempts').with_value(15) + is_expected.to contain_octavia_config('haproxy_amphora/api_db_commit_retry_initial_delay').with_value(1) + is_expected.to contain_octavia_config('haproxy_amphora/api_db_commit_retry_backoff').with_value(1) + is_expected.to contain_octavia_config('haproxy_amphora/api_db_commit_retry_max').with_value(5) is_expected.to contain_octavia_config('haproxy_amphora/default_connection_limit').with_value(50000) is_expected.to contain_octavia_config('amphora_agent/agent_request_read_timeout').with_value(180) is_expected.to contain_octavia_config('amphora_agent/agent_tls_protocol').with_value('TLSv1.2') @@ -159,6 +175,10 @@ describe 'octavia::controller' do is_expected.to contain_octavia_config('controller_worker/amphora_delete_retries').with_value('') is_expected.to contain_octavia_config('controller_worker/amphora_delete_retry_interval').with_value('') is_expected.to contain_octavia_config('controller_worker/event_notifications').with_value('') + is_expected.to contain_octavia_config('controller_worker/db_commit_retry_attempts').with_value('') + is_expected.to contain_octavia_config('controller_worker/db_commit_retry_initial_delay').with_value('') + is_expected.to contain_octavia_config('controller_worker/db_commit_retry_backoff').with_value('') + is_expected.to contain_octavia_config('controller_worker/db_commit_retry_max').with_value('') is_expected.to contain_octavia_config('haproxy_amphora/timeout_client_data').with_value('') is_expected.to contain_octavia_config('haproxy_amphora/timeout_member_connect').with_value('') is_expected.to contain_octavia_config('haproxy_amphora/timeout_member_data').with_value('') @@ -173,6 +193,10 @@ describe 'octavia::controller' do is_expected.to contain_octavia_config('haproxy_amphora/build_rate_limit').with_value('') is_expected.to contain_octavia_config('haproxy_amphora/build_active_retries').with_value('') is_expected.to contain_octavia_config('haproxy_amphora/build_retry_interval').with_value('') + is_expected.to contain_octavia_config('haproxy_amphora/api_db_commit_retry_attempts').with_value('') + is_expected.to contain_octavia_config('haproxy_amphora/api_db_commit_retry_initial_delay').with_value('') + is_expected.to contain_octavia_config('haproxy_amphora/api_db_commit_retry_backoff').with_value('') + is_expected.to contain_octavia_config('haproxy_amphora/api_db_commit_retry_max').with_value('') is_expected.to contain_octavia_config('haproxy_amphora/default_connection_limit').with_value('') is_expected.to contain_octavia_config('amphora_agent/agent_request_read_timeout').with_value('') is_expected.to contain_octavia_config('amphora_agent/agent_tls_protocol').with_value('')