]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
Add backward comptible acting set until all OSDs updated 960/head
authorDavid Zafman <david.zafman@inktank.com>
Tue, 17 Dec 2013 06:08:07 +0000 (22:08 -0800)
committerDavid Zafman <david.zafman@inktank.com>
Tue, 17 Dec 2013 19:43:40 +0000 (11:43 -0800)
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 <david.zafman@inktank.com>
src/common/config_opts.h
src/osd/PG.cc

index 81b2854c0220070635e0ec6789fc1ebea855b001..4b3015941923bb251c5b4e6aee76aa6381a7c4e2 100644 (file)
@@ -528,6 +528,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)
index cc7092ff605f4342fd32ac51eece22f4b8e081d4..0ae5b76161cece7ca02b9d0c2d40b0220d7cf96b 100644 (file)
@@ -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;