From: Yehuda Sadeh Date: Mon, 12 May 2014 21:43:51 +0000 (-0700) Subject: client: remove replica log entries using purge-all X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fheads%2Fwip-8251;p=radosgw-agent.git client: remove replica log entries using purge-all After we converted the old replica log entry we now purge it using purge-all, so that next time we're not going to hit it. Signed-off-by: Yehuda Sadeh --- diff --git a/radosgw_agent/client.py b/radosgw_agent/client.py index 1ab6393..c1e9c83 100644 --- a/radosgw_agent/client.py +++ b/radosgw_agent/client.py @@ -317,6 +317,23 @@ def del_worker_bound(connection, type_, daemon_id, id_, index_by_instance = True expect_json=False, ) +def purge_bounds(connection, type_, id_, index_by_instance = True): + key = _id_name(type_) + p ={ + 'type': type_, + key: id_, + 'purge-all': 'true', + } + if not index_by_instance: + p['index-by-instance'] = 'false' + + return request( + connection, 'delete', 'admin/replica_log', + params=p, + special_first_param='work_bound', + expect_json=False, + ) + def get_worker_bound(connection, type_, id_): key = _id_name(type_) try: @@ -353,9 +370,8 @@ def get_worker_bound(connection, type_, id_): boto.log.debug('entities: %r', entities) - for e in entities: - boto.log.debug('removing entity: %r', e) - del_worker_bound(connection, type_, e, id_, index_by_instance = False) + boto.log.debug('purging all bounds for: %r', id_) + purge_bounds(connection, type_, id_, index_by_instance = False) raise