From c1d9151756278b7c31ef07b1e7cdc94b60d2a603 Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Mon, 8 Sep 2025 21:09:01 +0900 Subject: [PATCH] Add support for [orchestrator] max_workers_reprocessing ... to control the number of processes the orchestrator service may spawn. Change-Id: Ibcb3f2444d8fa203efc557eb8c75aece863d167e Signed-off-by: Takashi Kajinami --- manifests/orchestrator.pp | 20 ++++++++++++------- ...workers_reprocessing-dd0b413efd72cd7d.yaml | 5 +++++ spec/classes/cloudkitty_orchestrator_spec.rb | 9 ++++++--- 3 files changed, 24 insertions(+), 10 deletions(-) create mode 100644 releasenotes/notes/max_workers_reprocessing-dd0b413efd72cd7d.yaml diff --git a/manifests/orchestrator.pp b/manifests/orchestrator.pp index c92b618..6a757a7 100644 --- a/manifests/orchestrator.pp +++ b/manifests/orchestrator.pp @@ -9,7 +9,11 @@ # Defaults to $facts['os_service_default'] # # [*max_workers*] -# (Optional) Maximal number of workers to run. +# (Optional) Maximum number of workers to execute the rating process. +# Defaults to $facts['os_service_default'] +# +# [*max_workers_reprocessing*] +# (Optional) Maximum number of workers to execute the reprocessing. # Defaults to $facts['os_service_default'] # # [*max_threads*] @@ -17,9 +21,10 @@ # Defaults to $facts['os_service_default'] # class cloudkitty::orchestrator ( - $coordination_url = $facts['os_service_default'], - $max_workers = $facts['os_service_default'], - $max_threads = $facts['os_service_default'] + $coordination_url = $facts['os_service_default'], + $max_workers = $facts['os_service_default'], + $max_workers_reprocessing = $facts['os_service_default'], + $max_threads = $facts['os_service_default'] ) { include cloudkitty::deps @@ -33,8 +38,9 @@ class cloudkitty::orchestrator ( Oslo::Coordination['cloudkitty_config'] -> Anchor['cloudkitty::service::begin'] cloudkitty_config { - 'orchestrator/coordination_url': value => $coordination_url, secret => true; - 'orchestrator/max_workers': value => $max_workers; - 'orchestrator/max_threads': value => $max_threads; + 'orchestrator/coordination_url': value => $coordination_url, secret => true; + 'orchestrator/max_workers': value => $max_workers; + 'orchestrator/max_workers_reprocessing': value => $max_workers_reprocessing; + 'orchestrator/max_threads': value => $max_threads; } } diff --git a/releasenotes/notes/max_workers_reprocessing-dd0b413efd72cd7d.yaml b/releasenotes/notes/max_workers_reprocessing-dd0b413efd72cd7d.yaml new file mode 100644 index 0000000..277523f --- /dev/null +++ b/releasenotes/notes/max_workers_reprocessing-dd0b413efd72cd7d.yaml @@ -0,0 +1,5 @@ +--- +features: + - | + The new ``cloudkitty::orchestrator::max_workers_reprocessing`` parmaeter + has been added. diff --git a/spec/classes/cloudkitty_orchestrator_spec.rb b/spec/classes/cloudkitty_orchestrator_spec.rb index 94337d1..4f23d19 100644 --- a/spec/classes/cloudkitty_orchestrator_spec.rb +++ b/spec/classes/cloudkitty_orchestrator_spec.rb @@ -15,6 +15,7 @@ describe 'cloudkitty::orchestrator' do :manage_config => false, ) is_expected.to contain_cloudkitty_config('orchestrator/max_workers').with_value('') + is_expected.to contain_cloudkitty_config('orchestrator/max_workers_reprocessing').with_value('') is_expected.to contain_cloudkitty_config('orchestrator/max_threads').with_value('') end end @@ -22,9 +23,10 @@ describe 'cloudkitty::orchestrator' do context 'with parameters set' do let :params do { - :coordination_url => 'etcd3+http://127.0.0.1:2379', - :max_workers => 4, - :max_threads => 20, + :coordination_url => 'etcd3+http://127.0.0.1:2379', + :max_workers => 4, + :max_workers_reprocessing => 5, + :max_threads => 20, } end @@ -36,6 +38,7 @@ describe 'cloudkitty::orchestrator' do :manage_config => false, ) is_expected.to contain_cloudkitty_config('orchestrator/max_workers').with_value(4) + is_expected.to contain_cloudkitty_config('orchestrator/max_workers_reprocessing').with_value(5) is_expected.to contain_cloudkitty_config('orchestrator/max_threads').with_value(20) end end