Skip to content

Commit

Permalink
recovery: merge: print error message if key wasn't recovered via star…
Browse files Browse the repository at this point in the history
…t_copy_iterator()
  • Loading branch information
abudnik committed Jan 13, 2016
1 parent 8333f37 commit 688a8f1
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions recovery/elliptics_recovery/iterator.py
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ def start(self,
if iterated_keys % batch_size == 0:
yield (iterated_keys, total_keys, positive_responses, negative_responses, start, end)

self._on_key_response(results, record)
self._on_key_response(results, record, address, backend_id)
end = time.time()

elapsed_time = records.elapsed_time()
Expand All @@ -349,7 +349,7 @@ def _start_iterator(self, eid, ranges, flags, timestamp_range):
timestamp_range[0],
timestamp_range[1])

def _on_key_response(self, results, record):
def _on_key_response(self, results, record, address, backend_id):
if record.response.status == 0:
self._save_record(results, record)

Expand Down Expand Up @@ -408,8 +408,10 @@ def _start_iterator(self, eid, ranges, flags, timestamp_range):
flags |= elliptics.iterator_flags.move
return self.session.start_copy_iterator(eid, ranges, [eid.group_id], flags, timestamp_range[0], timestamp_range[1])

def _on_key_response(self, results, record):
def _on_key_response(self, results, record, address, backend_id):
if record.response.status != 0:
self.log.error("Key recovery on node: {0}/{1} failed: {2}, key: {3}"
.format(address, backend_id, record.response.status, record.response.key))
self._save_record(results, record)

def _update_stats(self, stats, it):
Expand Down

0 comments on commit 688a8f1

Please sign in to comment.