]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: add copyfrom error injection
authorSage Weil <sage@redhat.com>
Sun, 14 Dec 2014 05:16:24 +0000 (21:16 -0800)
committerSage Weil <sage@redhat.com>
Sat, 20 Dec 2014 15:30:04 +0000 (07:30 -0800)
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 <sage@redhat.com>
src/common/config_opts.h
src/osd/ReplicatedPG.cc

index 8313d0014191b204de5e5b259d697de1e7dcf61a..0808dd140912e564d06150aa8643cd5d0e1191e9 100644 (file)
@@ -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
index 5d5b98f452a65bb2392399b1b2bb08f818569d83..ca795d10507d42baff105cc7a13e08e2e20a1d81 100644 (file)
@@ -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;