Minor cleanup post efficent multi-region replication

One log line had a typo, and I refactored the per object cleanup code out of
update_deleted into the per object hashdir cleanup method.

Change-Id: I19d03d0706a75bd8ec2fe327a1eb1b5ec36de6d2
This commit is contained in:
Clay Gerrard 2015-02-12 16:15:42 -08:00
parent 923e17b2b8
commit 596042b9c7
2 changed files with 7 additions and 10 deletions

View File

@ -274,14 +274,9 @@ class ObjectReplicator(Daemon):
all(responses)
if not suffixes or delete_handoff:
if delete_objs:
self.logger.info(_("Removing %s objecs"),
self.logger.info(_("Removing %s objects"),
len(delete_objs))
delete_objs = [
storage_directory(job['obj_path'],
job['partition'],
object_hash)
for object_hash in delete_objs]
self.delete_handoff_paths(delete_objs)
self.delete_handoff_objs(job, delete_objs)
else:
self.logger.info(_("Removing partition: %s"), job['path'])
tpool.execute(
@ -292,8 +287,10 @@ class ObjectReplicator(Daemon):
self.partition_times.append(time.time() - begin)
self.logger.timing_since('partition.delete.timing', begin)
def delete_handoff_paths(self, paths):
for object_path in paths:
def delete_handoff_objs(self, job, delete_objs):
for object_hash in delete_objs:
object_path = storage_directory(job['obj_path'], job['partition'],
object_hash)
tpool.execute(shutil.rmtree, object_path, ignore_errors=True)
suffix_dir = dirname(object_path)
try:

View File

@ -684,7 +684,7 @@ class TestObjectReplicator(unittest.TestCase):
self.call_nums = 0
self.conf['sync_method'] = 'ssync'
def _fake_ssync(node, job, suffixes):
def _fake_ssync(node, job, suffixes, **kwags):
success = False
ret_val = []
if self.call_nums == 2: