Deprecate support for the allow_versions parameter

... which was deprecated since swift 2.16.0[1] in favor of
the versioned_writes middleware.

[1] 5e673a542401a2d95249c3c03f26175214f08c79

Change-Id: I6cf3e63839a2044ded0e5c4af2fe6f1312b42fdf
This commit is contained in:
Takashi Kajinami
2021-11-10 16:36:24 +09:00
parent 8e4a6b72f4
commit a1088139ec
5 changed files with 35 additions and 14 deletions

View File

@@ -26,10 +26,6 @@
# (optional) Specify the container pipeline
# Defaults to undef
#
# [*allow_versions*]
# (optional) Enable/Disable object versioning feature
# Defaults to false
#
# [*mount_check*]
# (optional) Whether or not check if the devices are mounted
# to prevent accidentally writing to the root device
@@ -123,6 +119,12 @@
# (optional) Override whether to use xinetd to manage rsync service
# Defaults to swift::params::xinetd_available
#
# DEPRECATED PARAMETERS
#
# [*allow_versions*]
# (optional) Enable/Disable object versioning feature
# Defaults to undef
#
class swift::storage::all(
$storage_local_net_ip,
$devices = '/srv/node',
@@ -131,7 +133,6 @@ class swift::storage::all(
$account_port = 6002,
$object_pipeline = undef,
$container_pipeline = undef,
$allow_versions = false,
$mount_check = true,
$account_pipeline = undef,
$log_facility = 'LOG_LOCAL2',
@@ -154,10 +155,16 @@ class swift::storage::all(
$splice = false,
$max_connections = 25,
$rsync_use_xinetd = $::swift::params::xinetd_available,
# DEPRECATED PARAMETERS
$allow_versions = undef,
) inherits swift::params {
include swift::deps
if $allow_versions != undef {
warning('The allow_versions parameter is deprecated and will be removed in a future release')
}
if ("${$object_port}" == '6000') {
warning('The default port for the object storage server has changed \
from 6000 to 6200 and will be changed in a later release')

View File

@@ -68,10 +68,6 @@
# See https://docs.openstack.org/swift/latest/deployment_guide.html#general-service-tuning
# Defaults to $::os_workers.
#
# [*allow_versions*]
# (optional) Enable/Disable object versioning feature
# Defaults to 'false'.
#
# [*replicator_concurrency*]
# (optional) Number of replicator workers to spawn.
# Defaults to 1.
@@ -173,6 +169,12 @@
# (optional) Number of MB allocated for the cache.
# Defaults to 512, which is the swift default value.
#
# DEPRECATED PARAMETERS
#
# [*allow_versions*]
# (optional) Enable/Disable object versioning feature
# Defaults to undef.
#
define swift::storage::server(
$type,
$storage_local_net_ip,
@@ -187,7 +189,6 @@ define swift::storage::server(
$servers_per_port = 0,
$user = 'swift',
$workers = $::os_workers,
$allow_versions = false,
$replicator_concurrency = 1,
$replicator_interval = 30,
$updater_concurrency = 1,
@@ -213,10 +214,16 @@ define swift::storage::server(
$auditor_disk_chunk_size = undef,
$splice = false,
$object_server_mb_per_sync = 512,
# DEPRECATED PARAMETERS
$allow_versions = undef,
) {
include swift::deps
if $allow_versions != undef {
warning('The allow_versions parameter is deprecated and will be removed in a future release')
}
if ($incoming_chmod == '0644') {
warning('The default incoming_chmod set to 0644 may yield in error prone directories and will be changed in a later release.')
}
@@ -241,7 +248,6 @@ define swift::storage::server(
validate_legacy(Enum['object', 'container', 'account'], 'validate_re',
$type, ['^object|container|account$'])
validate_legacy(Array, 'validate_array', $pipeline)
validate_legacy(Boolean, 'validate_bool', $allow_versions)
validate_legacy(Boolean, 'validate_bool', $splice)
# TODO - validate that name is an integer

View File

@@ -0,0 +1,8 @@
---
deprecations:
- |
The following two parameters have been deprecated, and will be removed
in a future release.
- ``swift::storage::all::allow_versions``
- ``swift::storage::server::allow_versions``

View File

@@ -41,7 +41,6 @@ describe 'swift::storage::all' do
:object_pipeline => ["healthcheck"],
:container_pipeline => ["healthcheck"],
:account_pipeline => ["healthcheck"],
:allow_versions => true,
:splice => true,
:log_facility => ['LOG_LOCAL2', 'LOG_LOCAL3'],
:incoming_chmod => '0644',
@@ -110,8 +109,7 @@ describe 'swift::storage::all' do
:config_file_path => 'container-server.conf',
:incoming_chmod => param_hash[:incoming_chmod],
:outgoing_chmod => param_hash[:outgoing_chmod],
:pipeline => param_hash[:container_pipeline] || ['container-server'],
:allow_versions => param_hash[:allow_versions] || false }.merge(storage_server_defaults)
:pipeline => param_hash[:container_pipeline] || ['container-server'] }.merge(storage_server_defaults)
)}
it { is_expected.to contain_class('rsync::server').with(

View File

@@ -29,7 +29,9 @@ log_statsd_metric_prefix = <%=@log_statsd_metric_prefix%>
pipeline = <%= @pipeline.to_a.join(' ') %>
[app:container-server]
<%- if ! @allow_versions.nil? -%>
allow_versions = <%= @allow_versions %>
<%- end -%>
use = egg:swift#container
set log_name = <%= @log_name %>
set log_facility = <%= @log_facility %>