bulk: Support more tunable options

This change adds the remaining tunable options of bulk middleware,
to control behavior of internal delete requests.

Change-Id: I71dda8a24c80564aef6647a67e65a8d21f851b66
This commit is contained in:
Takashi Kajinami 2022-09-05 00:26:15 +09:00
parent 10aef4e2ba
commit e94bbf51b4
3 changed files with 37 additions and 0 deletions

View File

@ -29,10 +29,24 @@
# has extraction failures.
# Defaults to $::os_service_default.
#
# [*max_failed_deletes*]
# (Optional) The maximum number of failed deletion allowed in a bulk delete
# of objects and their container.
# Defaults to $::os_service_default
#
# [*max_deletes_per_request*]
# (Optional) The maximum number of deletes allowed by each request.
# Defaults to $::os_service_default.
#
# [*delete_container_retry_count*]
# (Optional) Number of retries to delete container in a bulk delete of
# objects and their container.
# Defaults to $::os_service_default.
#
# [*delete_concurrency*]
# (Optional) The number of objects to delete at a time.
# Defaults to $::os_service_default.
#
# [*yield_frequency*]
# (Optional) The frequency the server will spit out an ' ' to keep
# the connection alive while its processing the request.
@ -41,7 +55,10 @@
class swift::proxy::bulk(
$max_containers_per_extraction = $::os_service_default,
$max_failed_extractions = $::os_service_default,
$max_failed_deletes = $::os_service_default,
$max_deletes_per_request = $::os_service_default,
$delete_container_retry_count = $::os_service_default,
$delete_concurrency = $::os_service_default,
$yield_frequency = $::os_service_default,
) {
@ -51,7 +68,10 @@ class swift::proxy::bulk(
'filter:bulk/use': value => 'egg:swift#bulk';
'filter:bulk/max_containers_per_extraction': value => $max_containers_per_extraction;
'filter:bulk/max_failed_extractions': value => $max_failed_extractions;
'filter:bulk/max_failed_deletes': value => $max_failed_deletes;
'filter:bulk/max_deletes_per_request': value => $max_deletes_per_request;
'filter:bulk/delete_container_retry_count': value => $delete_container_retry_count;
'filter:bulk/delete_concurrency': value => $delete_concurrency;
'filter:bulk/yield_frequency': value => $yield_frequency;
}
}

View File

@ -0,0 +1,8 @@
---
features:
- |
The ``swift::proxy::bulk`` class now supports the following new parameters.
- ``max_failed_deletes``
- ``delete_container_retry_count``
- ``delete_concurrency``

View File

@ -26,7 +26,10 @@ describe 'swift::proxy::bulk' do
it { is_expected.to contain_swift_proxy_config('filter:bulk/use').with_value('egg:swift#bulk') }
it { is_expected.to contain_swift_proxy_config('filter:bulk/max_containers_per_extraction').with_value('<SERVICE DEFAULT>') }
it { is_expected.to contain_swift_proxy_config('filter:bulk/max_failed_extractions').with_value('<SERVICE DEFAULT>') }
it { is_expected.to contain_swift_proxy_config('filter:bulk/max_failed_deletes').with_value('<SERVICE DEFAULT>') }
it { is_expected.to contain_swift_proxy_config('filter:bulk/max_deletes_per_request').with_value('<SERVICE DEFAULT>') }
it { is_expected.to contain_swift_proxy_config('filter:bulk/delete_container_retry_count').with_value('<SERVICE DEFAULT>') }
it { is_expected.to contain_swift_proxy_config('filter:bulk/delete_concurrency').with_value('<SERVICE DEFAULT>') }
it { is_expected.to contain_swift_proxy_config('filter:bulk/yield_frequency').with_value('<SERVICE DEFAULT>') }
end
@ -35,7 +38,10 @@ describe 'swift::proxy::bulk' do
{
:max_containers_per_extraction => 10000,
:max_failed_extractions => 1000,
:max_failed_deletes => 1001,
:max_deletes_per_request => 10001,
:delete_container_retry_count => 0,
:delete_concurrency => 2,
:yield_frequency => 10,
}
end
@ -43,7 +49,10 @@ describe 'swift::proxy::bulk' do
it { is_expected.to contain_swift_proxy_config('filter:bulk/use').with_value('egg:swift#bulk') }
it { is_expected.to contain_swift_proxy_config('filter:bulk/max_containers_per_extraction').with_value(10000) }
it { is_expected.to contain_swift_proxy_config('filter:bulk/max_failed_extractions').with_value(1000) }
it { is_expected.to contain_swift_proxy_config('filter:bulk/max_failed_deletes').with_value(1001) }
it { is_expected.to contain_swift_proxy_config('filter:bulk/max_deletes_per_request').with_value(10001) }
it { is_expected.to contain_swift_proxy_config('filter:bulk/delete_container_retry_count').with_value(0) }
it { is_expected.to contain_swift_proxy_config('filter:bulk/delete_concurrency').with_value(2) }
it { is_expected.to contain_swift_proxy_config('filter:bulk/yield_frequency').with_value(10) }
end
end