Merge "sharder: fix 'Cleaving not completed' warning log"
This commit is contained in:
commit
04c27e43a0
@ -1079,13 +1079,13 @@ class ContainerSharder(ContainerSharderConf, ContainerReplicator):
|
|||||||
# container DB, which predicates sharding starting. But s-m-s-r and
|
# 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
|
# auto-sharding do set epoch and then merge, so we use it to tell
|
||||||
# whether sharding has been taking too long or not.
|
# whether sharding has been taking too long or not.
|
||||||
self.warning(broker,
|
self.warning(
|
||||||
'Cleaving has not completed in %.2f seconds since %s.'
|
broker, 'Cleaving has not completed in %.2f seconds since %s. '
|
||||||
'DB state: %s, own_shard_range state: %s, '
|
'DB state: %s, own_shard_range state: %s, state count of '
|
||||||
'state count of shard ranges: %s' %
|
'shard ranges: %s' %
|
||||||
(time.time() - float(own_shard_range.epoch),
|
(time.time() - float(own_shard_range.epoch),
|
||||||
own_shard_range.epoch.isoformat, db_state,
|
own_shard_range.epoch.isoformat, db_state,
|
||||||
own_shard_range.state_text, str(state_count)))
|
own_shard_range.state_text, str(state_count)))
|
||||||
|
|
||||||
def _report_stats(self):
|
def _report_stats(self):
|
||||||
# report accumulated stats since start of one sharder cycle
|
# report accumulated stats since start of one sharder cycle
|
||||||
|
@ -3373,9 +3373,9 @@ class TestSharder(BaseTestSharder):
|
|||||||
sharder._record_sharding_progress(broker, {}, None)
|
sharder._record_sharding_progress(broker, {}, None)
|
||||||
warning_lines = sharder.logger.get_lines_for_level('warning')
|
warning_lines = sharder.logger.get_lines_for_level('warning')
|
||||||
self.assertIn(
|
self.assertIn(
|
||||||
'Cleaving has not completed in %.2f seconds since %s.' %
|
'Cleaving has not completed in %.2f seconds since %s. DB state: '
|
||||||
(future_time - float(own_shard_range.epoch),
|
'sharding' % (future_time - float(own_shard_range.epoch),
|
||||||
own_shard_range.epoch.isoformat),
|
own_shard_range.epoch.isoformat),
|
||||||
warning_lines[0])
|
warning_lines[0])
|
||||||
|
|
||||||
def test_incomplete_shrinking_progress_warning_log(self):
|
def test_incomplete_shrinking_progress_warning_log(self):
|
||||||
|
Loading…
Reference in New Issue
Block a user