]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: do not diagnose misdirected ops by default
authorSage Weil <sage@redhat.com>
Wed, 16 Nov 2016 16:14:36 +0000 (10:14 -0600)
committerSage Weil <sage@redhat.com>
Wed, 16 Nov 2016 16:14:36 +0000 (10:14 -0600)
This is computationally expensive, potentially even blocks on IO (to load
an old OSDMap), and is only useful for debugging buggy clients.  We'll
enable it in QA, but leave it off by default.

Signed-off-by: Sage Weil <sage@redhat.com>
src/common/config_opts.h
src/osd/OSD.cc

index 99237c7872443f49f01055d970e80eb8f3d93672..265f1319f7020f6e1c9043d907ef6b8e29ed281f 100644 (file)
@@ -839,6 +839,7 @@ 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_debug_randomize_hobject_sort_order, OPT_BOOL, false)
+OPTION(osd_debug_misdirected_ops, OPT_BOOL, false)
 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 4d891a493d631a7bc63ee30531e5d58ed029c080..14839fb48092107000e4404b88f6bddbe8623f61 100644 (file)
@@ -8689,10 +8689,14 @@ void OSD::handle_op(OpRequestRef& op, OSDMapRef& osdmap)
     return;
   }
 
-  // ok, we didn't have the PG.  let's see if it's our fault or the client's.
+  // ok, we didn't have the PG.
+  if (!g_conf->osd_debug_misdirected_ops) {
+    return;
+  }
+  // let's see if it's our fault or the client's.  note that this might
+  // involve loading an old OSDmap off disk, so it can be slow.
 
   OSDMapRef send_map = service.try_get_map(m->get_map_epoch());
-  // check send epoch
   if (!send_map) {
     dout(7) << "don't have sender's osdmap; assuming it was valid and that"
            << " client will resend" << dendl;