]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: Determine if compatibility is required due to back level OSDs
authorDavid Zafman <david.zafman@inktank.com>
Fri, 20 Dec 2013 22:35:56 +0000 (14:35 -0800)
committerDavid Zafman <david.zafman@inktank.com>
Thu, 9 Jan 2014 00:33:57 +0000 (16:33 -0800)
fixes: #7039

Signed-off-by: David Zafman <david.zafman@inktank.com>
src/osd/PG.cc

index 1daa150f3077a1c4a43ca9c8aa42d9165dd72873..6a2cf7c0a4f0c69fc7544152e438f4a829641e44 100644 (file)
@@ -1005,10 +1005,30 @@ 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) {
+    bool all_support = true;
+    OSDMapRef osdmap = get_osdmap();
+    vector<int> allpeers;
+
+    allpeers = want;
+    allpeers.insert(allpeers.end(), backfill.begin(), backfill.end());
+    for (vector<int>::iterator it = allpeers.begin();
+       it != allpeers.end(); ++it) {
+      int peer = *it;
+
+      const osd_xinfo_t& xi = osdmap->get_xinfo(peer);
+      if (!(xi.features & CEPH_FEATURE_OSD_ERASURE_CODES)) {
+       all_support = false;
+       break;
+      }
+    }
+    if (all_support)
+      compat_mode = false;
+  }
+
   // For now we only backfill 1 at a time as before
   if (!backfill.empty())
     backfill.resize(1);