]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
Add backward comptible acting set until all OSDs updated
authorDavid Zafman <david.zafman@inktank.com>
Tue, 17 Dec 2013 06:08:07 +0000 (22:08 -0800)
committerDavid Zafman <david.zafman@inktank.com>
Fri, 20 Dec 2013 05:23:52 +0000 (21:23 -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>
Reviewed-by: Samuel Just <sam.just@inktank.com>
(cherry picked from commit 19cff890eb6083eefdb7b709773313b2c8acbcea)

src/common/config_opts.h
src/osd/PG.cc

index c51f7e3cd15d5dba7c8f179b7446a8bcf8af9bcb..2eb31b9561758005b0efcdd2fafe20ae052950aa 100644 (file)
@@ -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)
index 17337803a23fd5ea248f69d43109977a611f3230..78e77064259536675127f66e7ec84f1a93fbf926 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;