From 0bd5cb65ef1357110b791b83787dd7e05384b47e Mon Sep 17 00:00:00 2001 From: David Zafman Date: Mon, 16 Dec 2013 22:08:07 -0800 Subject: [PATCH] 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) --- src/common/config_opts.h | 3 +++ src/osd/PG.cc | 15 ++++++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/common/config_opts.h b/src/common/config_opts.h index c51f7e3cd15d5..2eb31b9561758 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 17337803a23fd..78e7706425953 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; -- 2.39.5