Skip to content

Commit

Permalink
repair: Log keyspace and table name in repair_cf_range
Browse files Browse the repository at this point in the history
When a repair failed, we saw logs like:

   repair - Checksum of range (8235770168569320790, 8235957818553794560] on
   127.0.0.1 failed: std::bad_alloc (std::bad_alloc)

It is hard to tell which keyspace and table has failed.

To fix, log the keyspace and table name. It is useful to know when debugging.

Fixes scylladb#4166
Message-Id: <8424d314125b88bf5378ea02a703b0f82c2daeda.1548818669.git.asias@scylladb.com>
  • Loading branch information
asias authored and avikivity committed Jan 31, 2019
1 parent a70374d commit 9d9ecda
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions repair/repair.cc
Original file line number Diff line number Diff line change
Expand Up @@ -803,8 +803,8 @@ static future<> repair_cf_range(repair_info& ri,
for (unsigned i = 0; i < checksums.size(); i++) {
if (checksums[i].failed()) {
rlogger.warn(
"Checksum of range {} on {} failed: {}",
range,
"Checksum of ks={}, table={}, range={} on {} failed: {}",
ri.keyspace, cf, range,
(i ? neighbors[i-1] :
utils::fb_utilities::get_broadcast_address()),
checksums[i].get_exception());
Expand Down Expand Up @@ -922,8 +922,8 @@ static future<> repair_cf_range(repair_info& ri,
}
}
if (!(live_neighbors_in.empty() && live_neighbors_out.empty())) {
rlogger.debug("Found differing range {} on nodes {}, in = {}, out = {}", range,
live_neighbors, live_neighbors_in, live_neighbors_out);
rlogger.debug("Found differing ks={}, table={}, range={} on nodes={}, in = {}, out = {}",
ri.keyspace, cf, range, live_neighbors, live_neighbors_in, live_neighbors_out);
ri.check_in_abort();
return ri.request_transfer_ranges(cf, range, live_neighbors_in, live_neighbors_out);
}
Expand All @@ -937,13 +937,13 @@ static future<> repair_cf_range(repair_info& ri,
// tell the caller.
success = false;
ri.nr_failed_ranges++;
rlogger.warn("Failed sync of range {}: {}", range, eptr);
rlogger.warn("Failed to sync ks={}, table={}, range={}: {}", ri.keyspace, cf, range, eptr);
});
});
}).finally([&success, &completion] {
return completion.close().then([&success] {
}).finally([&success, &completion, &ri, &cf] {
return completion.close().then([&success, &ri, &cf] {
if (!success) {
rlogger.warn("Checksum or sync of partial range failed");
rlogger.warn("Checksum or sync of partial range failed, ks={}, table={}", ri.keyspace, cf);
}
// We probably want the repair contiunes even if some
// ranges fail to do the checksum. We need to set the
Expand Down

0 comments on commit 9d9ecda

Please sign in to comment.