From bb483f0e28fab60b10bba5b03246029d8bd7041c Mon Sep 17 00:00:00 2001 From: Thomas Goirand Date: Tue, 24 Nov 2020 16:47:56 +0100 Subject: [PATCH] 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 --- manifests/params.pp | 3 +++ manifests/storage/container.pp | 10 ++++++++++ manifests/storage/server.pp | 19 +++++++++++++++++++ .../container-sharder-7b000d34210dbe08.yaml | 5 +++++ templates/container-server.conf.erb | 3 +++ 5 files changed, 40 insertions(+) create mode 100644 releasenotes/notes/container-sharder-7b000d34210dbe08.yaml diff --git a/manifests/params.pp b/manifests/params.pp index 505bd69c..90794e9f 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -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', diff --git a/manifests/storage/container.pp b/manifests/storage/container.pp index cc5ec23f..2ddcad25 100644 --- a/manifests/storage/container.pp +++ b/manifests/storage/container.pp @@ -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}"], + } } diff --git a/manifests/storage/server.pp b/manifests/storage/server.pp index 06acb65e..27a62820 100644 --- a/manifests/storage/server.pp +++ b/manifests/storage/server.pp @@ -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, ) { diff --git a/releasenotes/notes/container-sharder-7b000d34210dbe08.yaml b/releasenotes/notes/container-sharder-7b000d34210dbe08.yaml new file mode 100644 index 00000000..6c05b872 --- /dev/null +++ b/releasenotes/notes/container-sharder-7b000d34210dbe08.yaml @@ -0,0 +1,5 @@ +--- +features: + - | + Now puppet-swift supports configurations required by the container-sharder + service. diff --git a/templates/container-server.conf.erb b/templates/container-server.conf.erb index 08be17eb..cfc17b46 100644 --- a/templates/container-server.conf.erb +++ b/templates/container-server.conf.erb @@ -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 %>