From: David Zafman Date: Fri, 20 Dec 2013 22:35:56 +0000 (-0800) Subject: osd: Determine if compatibility is required due to back level OSDs X-Git-Tag: v0.77~23^2~8 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=f9a11ef2f267591a38feea543a7903936702c76a;p=ceph.git osd: Determine if compatibility is required due to back level OSDs fixes: #7039 Signed-off-by: David Zafman --- diff --git a/src/osd/PG.cc b/src/osd/PG.cc index 1daa150f3077..6a2cf7c0a4f0 100644 --- a/src/osd/PG.cc +++ b/src/osd/PG.cc @@ -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 allpeers; + + allpeers = want; + allpeers.insert(allpeers.end(), backfill.begin(), backfill.end()); + for (vector::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);