diff --git a/swift/container/sharder.py b/swift/container/sharder.py index 378bad7c94..cfbcbede49 100644 --- a/swift/container/sharder.py +++ b/swift/container/sharder.py @@ -1079,13 +1079,13 @@ class ContainerSharder(ContainerSharderConf, ContainerReplicator): # container DB, which predicates sharding starting. But s-m-s-r and # auto-sharding do set epoch and then merge, so we use it to tell # whether sharding has been taking too long or not. - self.warning(broker, - 'Cleaving has not completed in %.2f seconds since %s.' - 'DB state: %s, own_shard_range state: %s, ' - 'state count of shard ranges: %s' % - (time.time() - float(own_shard_range.epoch), - own_shard_range.epoch.isoformat, db_state, - own_shard_range.state_text, str(state_count))) + self.warning( + broker, 'Cleaving has not completed in %.2f seconds since %s. ' + 'DB state: %s, own_shard_range state: %s, state count of ' + 'shard ranges: %s' % + (time.time() - float(own_shard_range.epoch), + own_shard_range.epoch.isoformat, db_state, + own_shard_range.state_text, str(state_count))) def _report_stats(self): # report accumulated stats since start of one sharder cycle diff --git a/test/unit/container/test_sharder.py b/test/unit/container/test_sharder.py index f73f202545..5981650e10 100644 --- a/test/unit/container/test_sharder.py +++ b/test/unit/container/test_sharder.py @@ -3373,9 +3373,9 @@ class TestSharder(BaseTestSharder): sharder._record_sharding_progress(broker, {}, None) warning_lines = sharder.logger.get_lines_for_level('warning') self.assertIn( - 'Cleaving has not completed in %.2f seconds since %s.' % - (future_time - float(own_shard_range.epoch), - own_shard_range.epoch.isoformat), + 'Cleaving has not completed in %.2f seconds since %s. DB state: ' + 'sharding' % (future_time - float(own_shard_range.epoch), + own_shard_range.epoch.isoformat), warning_lines[0]) def test_incomplete_shrinking_progress_warning_log(self):