]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: add failure injection on pg removals 3480/head
authorSage Weil <sage@redhat.com>
Sat, 24 Jan 2015 00:08:33 +0000 (16:08 -0800)
committerSage Weil <sage@redhat.com>
Sat, 24 Jan 2015 00:08:33 +0000 (16:08 -0800)
Trigger a failure before final PG removal so we can test that the OSD will
complete interrupted PG removal.

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

index bd053b1d372d65586a4f3550f452c790ad7913fc..76726428e21c01b51d67ab785617c5b2aba8ff84 100644 (file)
@@ -531,6 +531,7 @@ OPTION(osd_map_cache_size, OPT_INT, 500)
 OPTION(osd_map_message_max, OPT_INT, 100)  // max maps per MOSDMap message
 OPTION(osd_map_share_max_epochs, OPT_INT, 100)  // cap on # of inc maps we send to peers, clients
 OPTION(osd_inject_bad_map_crc_probability, OPT_FLOAT, 0)
+OPTION(osd_inject_failure_on_pg_removal, OPT_BOOL, false)
 OPTION(osd_op_threads, OPT_INT, 2)    // 0 == no threading
 OPTION(osd_peering_wq_batch_size, OPT_U64, 20)
 OPTION(osd_op_pq_max_tokens_per_priority, OPT_U64, 4194304)
index 07782e7da532d4f62eb04641b0389ab7c3de3c1b..19d7c91dab5581e9f8693c5d1053d16d8a3030c9 100644 (file)
@@ -4164,6 +4164,10 @@ void OSD::RemoveWQ::_process(
   for (list<coll_t>::iterator i = colls_to_remove.begin();
        i != colls_to_remove.end();
        ++i) {
+    if (g_conf->osd_inject_failure_on_pg_removal) {
+      generic_derr << "osd_inject_failure_on_pg_removal" << dendl;
+      exit(1);
+    }
     t->remove_collection(*i);
   }