Merge pull request #5865 from dzafman/wip-13016

osd: Add config option osd_read_ec_check_for_errors for testing

Reviewed-by: Samuel Just <sjust@redhat.com>
This commit is contained in:
Samuel Just 2015-10-30 08:17:59 -07:00
commit e74183ea88
2 changed files with 19 additions and 4 deletions

View File

@ -617,6 +617,11 @@ OPTION(osd_recover_clone_overlap, OPT_BOOL, true) // preserve clone_overlap du
OPTION(osd_op_num_threads_per_shard, OPT_INT, 2)
OPTION(osd_op_num_shards, OPT_INT, 5)
// Set to true for testing. Users should NOT set this.
// If set to true even after reading enough shards to
// decode the object, any error will be reported.
OPTION(osd_read_ec_check_for_errors, OPT_BOOL, false) // return error if any ec shard has an error
// Only use clone_overlap for recovery if there are fewer than
// osd_recover_clone_overlap_limit entries in the overlap set
OPTION(osd_recover_clone_overlap_limit, OPT_INT, 10)

View File

@ -1121,11 +1121,21 @@ void ECBackend::handle_sub_read_reply(
++is_complete;
}
} else {
if (!rop.complete[iter->first].errors.empty())
dout(10) << __func__ << " Enough copies for " << iter->first << " (ignore errors)" << dendl;
++is_complete;
rop.complete[iter->first].errors.clear();
assert(rop.complete[iter->first].r == 0);
if (!rop.complete[iter->first].errors.empty()) {
if (cct->_conf->osd_read_ec_check_for_errors) {
dout(10) << __func__ << ": Not ignoring errors, use one shard err=" << err << dendl;
err = rop.complete[iter->first].errors.begin()->second;
rop.complete[iter->first].r = err;
} else {
get_parent()->clog_error() << __func__ << ": Error(s) ignored for "
<< iter->first << " enough copies available" << "\n";
dout(10) << __func__ << " Error(s) ignored for " << iter->first
<< " enough copies available" << dendl;
rop.complete[iter->first].errors.clear();
}
}
++is_complete;
}
}
}