From 6dc85b0f7918fa295974f7afbb1a6b8a26f8f953 Mon Sep 17 00:00:00 2001 From: Emilien Macchi Date: Thu, 9 Apr 2015 15:23:01 -0400 Subject: [PATCH] Notify services if swift.conf is modified swift.conf contains the hash_suffix. With the current module, we have a race condition where services can start *before* having the right hash in swift.conf, so some objects mays be put in quarantine. When usint swift_config (which affect swift.conf), we should restart all services to ensure our ring is running correctly. Change-Id: I1087ba4ec079ca9c43bea9ff0511347632871ec2 Closes-bug: #1442329 --- manifests/proxy.pp | 2 ++ manifests/storage/account.pp | 4 ++++ manifests/storage/container.pp | 5 +++++ manifests/storage/generic.pp | 1 + manifests/storage/object.pp | 4 ++++ 5 files changed, 16 insertions(+) diff --git a/manifests/proxy.pp b/manifests/proxy.pp index 503a8d54..f5f10a04 100644 --- a/manifests/proxy.pp +++ b/manifests/proxy.pp @@ -135,6 +135,8 @@ class swift::proxy( include ::swift::params include ::concat::setup + Swift_config<| |> ~> Service['swift-proxy'] + validate_bool($account_autocreate) validate_bool($allow_account_management) validate_array($pipeline) diff --git a/manifests/storage/account.pp b/manifests/storage/account.pp index 3a66d678..72f130ca 100644 --- a/manifests/storage/account.pp +++ b/manifests/storage/account.pp @@ -18,6 +18,10 @@ class swift::storage::account( $enabled = true, $package_ensure = 'present' ) { + + Swift_config<| |> ~> Service['swift-account-reaper'] + Swift_config<| |> ~> Service['swift-account-auditor'] + swift::storage::generic { 'account': manage_service => $manage_service, enabled => $enabled, diff --git a/manifests/storage/container.pp b/manifests/storage/container.pp index f11bc03b..aa054f52 100644 --- a/manifests/storage/container.pp +++ b/manifests/storage/container.pp @@ -23,6 +23,10 @@ class swift::storage::container( $package_ensure = 'present', $allowed_sync_hosts = ['127.0.0.1'], ) { + + Swift_config<| |> ~> Service['swift-container-updater'] + Swift_config<| |> ~> Service['swift-container-auditor'] + swift::storage::generic { 'container': manage_service => $manage_service, enabled => $enabled, @@ -71,5 +75,6 @@ class swift::storage::container( provider => $::swift::params::service_provider, require => File['/etc/init/swift-container-sync.conf', '/etc/init.d/swift-container-sync'], } + Swift_config<| |> ~> Service['swift-container-sync'] } } diff --git a/manifests/storage/generic.pp b/manifests/storage/generic.pp index 928d52e9..a6fc9bcf 100644 --- a/manifests/storage/generic.pp +++ b/manifests/storage/generic.pp @@ -38,6 +38,7 @@ define swift::storage::generic( include ::swift::params Class['swift::storage'] -> Swift::Storage::Generic[$name] + Swift_config<| |> ~> Service["swift-${name}"] validate_re($name, '^object|container|account$') diff --git a/manifests/storage/object.pp b/manifests/storage/object.pp index 2055843d..243e0d97 100644 --- a/manifests/storage/object.pp +++ b/manifests/storage/object.pp @@ -18,6 +18,10 @@ class swift::storage::object( $enabled = true, $package_ensure = 'present' ) { + + Swift_config<| |> ~> Service['swift-object-updater'] + Swift_config<| |> ~> Service['swift-object-auditor'] + swift::storage::generic { 'object': manage_service => $manage_service, enabled => $enabled,