From: Sage Weil Date: Sun, 14 Dec 2014 05:16:24 +0000 (-0800) Subject: osd: add copyfrom error injection X-Git-Tag: v0.92~111^2~4 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=5d2d839dd92869ce53c00071009ae6ea3653adb6;p=ceph.git osd: add copyfrom error injection Unfortunately it's nontrivial to inject this from the usual ceph_test_rados_api_* tests which need to run despite thrashing. Signed-off-by: Sage Weil --- diff --git a/src/common/config_opts.h b/src/common/config_opts.h index 8313d0014191..0808dd140912 100644 --- a/src/common/config_opts.h +++ b/src/common/config_opts.h @@ -600,6 +600,7 @@ OPTION(osd_debug_verify_snaps_on_info, OPT_BOOL, false) OPTION(osd_debug_verify_stray_on_activate, OPT_BOOL, false) OPTION(osd_debug_skip_full_check_in_backfill_reservation, OPT_BOOL, false) OPTION(osd_debug_reject_backfill_probability, OPT_DOUBLE, 0) +OPTION(osd_debug_inject_copyfrom_error, OPT_BOOL, false) // inject failure during copyfrom completion OPTION(osd_enable_op_tracker, OPT_BOOL, true) // enable/disable OSD op tracking OPTION(osd_num_op_tracker_shard, OPT_U32, 32) // The number of shards for holding the ops OPTION(osd_op_history_size, OPT_U32, 20) // Max number of completed ops to track diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc index 5d5b98f452a6..ca795d10507d 100644 --- a/src/osd/ReplicatedPG.cc +++ b/src/osd/ReplicatedPG.cc @@ -6202,6 +6202,11 @@ void ReplicatedPG::process_copy_chunk(hobject_t oid, ceph_tid_t tid, int r) r = -EIO; goto out; } + if (g_conf->osd_debug_inject_copyfrom_error) { + derr << __func__ << " injecting copyfrom failure" << dendl; + r = -EIO; + goto out; + } dout(20) << __func__ << " success; committing" << dendl;