From: David Zafman Date: Tue, 17 Dec 2013 06:08:07 +0000 (-0800) Subject: Add backward comptible acting set until all OSDs updated X-Git-Tag: v0.74~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=0bd5cb65ef1357110b791b83787dd7e05384b47e;p=ceph.git Add backward comptible acting set until all OSDs updated Add configuration variable to override compatible acting set handling. Later we'll check the osdmap that all OSDs are updated to use new acting sets. Fixes: #6990 Signed-off-by: David Zafman Reviewed-by: Samuel Just (cherry picked from commit 19cff890eb6083eefdb7b709773313b2c8acbcea) --- diff --git a/src/common/config_opts.h b/src/common/config_opts.h index c51f7e3cd15d..2eb31b956175 100644 --- a/src/common/config_opts.h +++ b/src/common/config_opts.h @@ -524,6 +524,9 @@ OPTION(osd_max_object_size, OPT_U64, 100*1024L*1024L*1024L) // OSD's maximum obj OPTION(osd_max_attr_size, OPT_U64, 0) OPTION(osd_objectstore, OPT_STR, "filestore") // ObjectStore backend type +// Override maintaining compatibility with older OSDs +// Set to true for testing. Users should NOT set this. +OPTION(osd_debug_override_acting_compat, OPT_BOOL, false) /// filestore wb throttle limits OPTION(filestore_wbthrottle_enable, OPT_BOOL, true) diff --git a/src/osd/PG.cc b/src/osd/PG.cc index 17337803a23f..78e770642595 100644 --- a/src/osd/PG.cc +++ b/src/osd/PG.cc @@ -1018,6 +1018,18 @@ bool PG::choose_acting(int& newest_update_osd) return false; } + // TODO: Add check of osdmap for all OSDs to be able to handle new acting + // Determine if compatibility needed + bool compat_mode = !cct->_conf->osd_debug_override_acting_compat; + + if (compat_mode) { + // May not be necessary, but the old mechanism only did one at a time + if (!backfill.empty()) + backfill.resize(1); + + want.insert(want.end(), backfill.begin(), backfill.end()); + } + if (want != acting) { dout(10) << "choose_acting want " << want << " != acting " << acting << ", requesting pg_temp change" << dendl; @@ -1038,7 +1050,8 @@ bool PG::choose_acting(int& newest_update_osd) // we've accepted the acting set. Now we can create // actingbackfill and backfill_targets vectors. actingbackfill = acting; - actingbackfill.insert(actingbackfill.end(), backfill.begin(), backfill.end()); + if (!compat_mode) + actingbackfill.insert(actingbackfill.end(), backfill.begin(), backfill.end()); assert(backfill_targets.empty() || backfill_targets == backfill); if (backfill_targets.empty()) { backfill_targets = backfill;