From 2b1eec79f64c1deb8a65988c8492e63187d6c674 Mon Sep 17 00:00:00 2001 From: Tim Burke Date: Wed, 4 Nov 2020 15:56:00 -0800 Subject: [PATCH] Continue logging deprecation warnings for run_pause ...even after the operator has configured interval. This was raised during the Oct 2020 ops feedback session. Change-Id: Ie44de8f15df63813367b76e1b96be456fac9b2b0 --- swift/common/db_replicator.py | 22 +++++++++++++++------- swift/obj/reconstructor.py | 19 +++++++++++++------ swift/obj/replicator.py | 18 ++++++++++++------ 3 files changed, 40 insertions(+), 19 deletions(-) diff --git a/swift/common/db_replicator.py b/swift/common/db_replicator.py index 2c2f57bd7e..fa180b6f47 100644 --- a/swift/common/db_replicator.py +++ b/swift/common/db_replicator.py @@ -198,13 +198,21 @@ class Replicator(Daemon): self.max_diffs = int(conf.get('max_diffs') or 100) self.interval = int(conf.get('interval') or conf.get('run_pause') or 30) - if 'run_pause' in conf and 'interval' not in conf: - self.logger.warning('Option %(type)s-replicator/run_pause ' - 'is deprecated and will be removed in a ' - 'future version. Update your configuration' - ' to use option %(type)s-replicator/' - 'interval.' - % {'type': self.server_type}) + if 'run_pause' in conf: + if 'interval' in conf: + self.logger.warning( + 'Option %(type)s-replicator/run_pause is deprecated ' + 'and %(type)s-replicator/interval is already configured. ' + 'You can safely remove run_pause; it is now ignored and ' + 'will be removed in a future version.' + % {'type': self.server_type}) + else: + self.logger.warning( + 'Option %(type)s-replicator/run_pause is deprecated ' + 'and will be removed in a future version. ' + 'Update your configuration to use option ' + '%(type)s-replicator/interval.' + % {'type': self.server_type}) self.databases_per_second = float( conf.get('databases_per_second', 50)) self.node_timeout = float(conf.get('node_timeout', 10)) diff --git a/swift/obj/reconstructor.py b/swift/obj/reconstructor.py index 135f9d5f9f..36ab5f3823 100644 --- a/swift/obj/reconstructor.py +++ b/swift/obj/reconstructor.py @@ -168,12 +168,19 @@ class ObjectReconstructor(Daemon): self.partition_times = [] self.interval = int(conf.get('interval') or conf.get('run_pause') or 30) - if 'run_pause' in conf and 'interval' not in conf: - self.logger.warning('Option object-reconstructor/run_pause ' - 'is deprecated and will be removed in a ' - 'future version. Update your configuration' - ' to use option object-reconstructor/' - 'interval.') + if 'run_pause' in conf: + if 'interval' in conf: + self.logger.warning( + 'Option object-reconstructor/run_pause is deprecated and ' + 'object-reconstructor/interval is already configured. ' + 'You can safely remove run_pause; it is now ignored and ' + 'will be removed in a future version.') + else: + self.logger.warning( + 'Option object-reconstructor/run_pause is deprecated ' + 'and will be removed in a future version. ' + 'Update your configuration to use option ' + 'object-reconstructor/interval.') self.http_timeout = int(conf.get('http_timeout', 60)) self.lockup_timeout = int(conf.get('lockup_timeout', 1800)) self.recon_cache_path = conf.get('recon_cache_path', diff --git a/swift/obj/replicator.py b/swift/obj/replicator.py index 230b2fc797..dcab26fe11 100644 --- a/swift/obj/replicator.py +++ b/swift/obj/replicator.py @@ -148,12 +148,18 @@ class ObjectReplicator(Daemon): self.partition_times = [] self.interval = int(conf.get('interval') or conf.get('run_pause') or 30) - if 'run_pause' in conf and 'interval' not in conf: - self.logger.warning('Option object-replicator/run_pause ' - 'is deprecated and will be removed in a ' - 'future version. Update your configuration' - ' to use option object-replicator/' - 'interval.') + if 'run_pause' in conf: + if 'interval' in conf: + self.logger.warning( + 'Option object-replicator/run_pause is deprecated and ' + 'object-replicator/interval is already configured. You ' + 'can safely remove run_pause; it is now ignored and will ' + 'be removed in a future version.') + else: + self.logger.warning( + 'Option object-replicator/run_pause is deprecated and ' + 'will be removed in a future version. Update your ' + 'configuration to use option object-replicator/interval.') self.rsync_timeout = int(conf.get('rsync_timeout', DEFAULT_RSYNC_TIMEOUT)) self.rsync_io_timeout = conf.get('rsync_io_timeout', '30')