From: Samuel Just Date: Sat, 7 Dec 2013 04:51:28 +0000 (-0800) Subject: PG: prefer older last_update for ec_pool X-Git-Tag: v0.78~286^2~51 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=6d05fa23be03051ea41fa973eacd1e77f3f6821d;p=ceph.git PG: prefer older last_update for ec_pool Signed-off-by: Samuel Just --- diff --git a/src/osd/PG.cc b/src/osd/PG.cc index c5470518d0f4..8aaf18184c17 100644 --- a/src/osd/PG.cc +++ b/src/osd/PG.cc @@ -794,7 +794,8 @@ map::const_iterator PG::find_best_info(const map assert(min_last_update_acceptable != eversion_t::max()); map::const_iterator best = infos.end(); - // find osd with newest last_update. if there are multiples, prefer + // find osd with newest last_update (oldest for ec_pool). + // if there are multiples, prefer // - a longer tail, if it brings another peer into log contiguity // - the current primary for (map::const_iterator p = infos.begin(); @@ -811,11 +812,20 @@ map::const_iterator PG::find_best_info(const map continue; } // Prefer newer last_update - if (p->second.last_update < best->second.last_update) - continue; - if (p->second.last_update > best->second.last_update) { - best = p; - continue; + if (pool.info.ec_pool()) { + if (p->second.last_update > best->second.last_update) + continue; + if (p->second.last_update < best->second.last_update) { + best = p; + continue; + } + } else { + if (p->second.last_update < best->second.last_update) + continue; + if (p->second.last_update > best->second.last_update) { + best = p; + continue; + } } // Prefer longer tail if it brings another peer into contiguity for (map::const_iterator q = infos.begin();