Add support for container sharder

This patch ensure that the swift-container-sharder service is started,
and provides all the facility (ie: parameters) to configure the sharder.

Change-Id: I0db7479e8634038871ce65990fd0104841d2010c
This commit is contained in:
Thomas Goirand
2020-11-24 16:47:56 +01:00
committed by Takashi Kajinami
parent 4683fb4f78
commit bb483f0e28
5 changed files with 40 additions and 0 deletions

View File

@@ -27,6 +27,7 @@ class swift::params {
$container_auditor_service_name = 'swift-container-auditor'
$container_replicator_service_name = 'swift-container-replicator'
$container_updater_service_name = 'swift-container-updater'
$container_sharder_service_name = 'swift-container-sharder'
$container_sync_service_name = 'swift-container-sync'
$container_reconciler_service_name = 'swift-container-reconciler'
$account_package_name = 'swift-account'
@@ -54,6 +55,7 @@ class swift::params {
$container_auditor_service_name = 'openstack-swift-container-auditor'
$container_replicator_service_name = 'openstack-swift-container-replicator'
$container_updater_service_name = 'openstack-swift-container-updater'
$container_sharder_service_name = 'openstack-swift-container-sharder'
$container_sync_service_name = 'openstack-swift-container-sync'
$container_reconciler_service_name = 'openstack-swift-container-reconciler'
$account_package_name = 'openstack-swift-account'
@@ -88,6 +90,7 @@ module ${module_name} only support osfamily RedHat and Debian")
'swift-container-auditor',
'swift-container-replicator',
'swift-container-server',
'swift-container-sharder',
'swift-container-sync',
'swift-container-updater',
'swift-container-reconciler',

View File

@@ -80,4 +80,14 @@ class swift::storage::container(
service_require => Package['swift-container'],
service_subscribe => Concat["/etc/swift/${config_file_name}"],
}
swift::service { 'swift-container-sharder':
os_family_service_name => $::swift::params::container_sharder_service_name,
service_ensure => $service_ensure,
enabled => $enabled,
config_file_name => $config_file_name,
service_provider => $service_provider,
service_require => Package['swift-container'],
service_subscribe => Concat["/etc/swift/${config_file_name}"],
}
}

View File

@@ -177,6 +177,20 @@
# (optional) Number of MB allocated for the cache.
# Defaults to 512, which is the swift default value.
#
# [*container_sharder_auto_shard*]
# (optional) If the auto_shard option is true then the sharder will
# automatically select containers to shard, scan for shard ranges,
# and select shards to shrink.
# Default to false.
#
# [*container_sharder_concurrency*]
# (optional) Number of replication workers to spawn.
# Default to 8.
#
# [*container_sharder_interval*]
# (optional) Time in seconds to wait between sharder cycles.
# Default to 30.
#
# DEPRECATED PARAMETERS
#
# [*allow_versions*]
@@ -224,6 +238,11 @@ define swift::storage::server(
$rsync_bwlimit = 0,
$splice = false,
$object_server_mb_per_sync = 512,
# These parameters only apply to container-server.conf,
# and define options for the container-sharder service.
$container_sharder_auto_shard = false,
$container_sharder_concurrency = 8,
$container_sharder_interval = 30,
# DEPRECATED PARAMETERS
$allow_versions = undef,
) {

View File

@@ -0,0 +1,5 @@
---
features:
- |
Now puppet-swift supports configurations required by the container-sharder
service.

View File

@@ -51,3 +51,6 @@ concurrency = <%= @updater_concurrency %>
[container-sync]
[container-sharder]
auto_shard = <%= @container_sharder_auto_shard %>
concurrency = <%= @container_sharder_concurrency %>
interval = <%= @container_sharder_interval %>