From: Sage Weil Date: Thu, 16 Aug 2018 17:30:02 +0000 (-0500) Subject: osd: base project_pg_history on is_new_interval X-Git-Tag: v14.0.1~371^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=4bc01379bbf946d2f5963dcca6b071914117ce4a;p=ceph.git osd: base project_pg_history on is_new_interval Signed-off-by: Sage Weil --- diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc index 0e302c385fe..3e3e5129f45 100644 --- a/src/osd/OSD.cc +++ b/src/osd/OSD.cc @@ -4370,7 +4370,7 @@ void OSD::build_initial_pg_history( * and same_primary_since. */ bool OSD::project_pg_history(spg_t pgid, pg_history_t& h, epoch_t from, - const OSDMap& endmap, + const OSDMapRef& endmap, const vector& currentup, int currentupprimary, const vector& currentacting, @@ -4391,7 +4391,6 @@ bool OSD::project_pg_history(spg_t pgid, pg_history_t& h, epoch_t from, dout(15) << __func__ << ": found map gap, returning false" << dendl; return false; } - ceph_assert(oldmap->have_pg_pool(pgid.pool())); int upprimary, actingprimary; vector up, acting; @@ -4402,25 +4401,18 @@ bool OSD::project_pg_history(spg_t pgid, pg_history_t& h, epoch_t from, &acting, &actingprimary); - // acting set change? - if ((actingprimary != currentactingprimary || - upprimary != currentupprimary || - acting != currentacting || - up != currentup) && e > h.same_interval_since) { - dout(15) << "project_pg_history " << pgid << " acting|up changed in " << e - << " from " << acting << "/" << up - << " " << actingprimary << "/" << upprimary - << " -> " << currentacting << "/" << currentup - << " " << currentactingprimary << "/" << currentupprimary - << dendl; - h.same_interval_since = e; - } - // split? - if (pgid.is_split(oldmap->get_pg_num(pgid.pool()), - endmap->get_pg_num(pgid.pool()), - 0) && e > h.same_interval_since) { + if (e > h.same_interval_since && + PastIntervals::is_new_interval( + actingprimary, currentactingprimary, + acting, currentacting, + upprimary, currentupprimary, + up, currentup, + oldmap, endmap, + pgid.pgid)) { + dout(15) << "project_pg_history " << pgid << " interval changed in " << e << dendl; h.same_interval_since = e; } + // up set change? if ((up != currentup || upprimary != currentupprimary) && e > h.same_up_since) { diff --git a/src/osd/OSD.h b/src/osd/OSD.h index 1e1e529a187..cace749e139 100644 --- a/src/osd/OSD.h +++ b/src/osd/OSD.h @@ -1926,7 +1926,7 @@ protected: /// project pg history from from to now bool project_pg_history( spg_t pgid, pg_history_t& h, epoch_t from, - const OSDMap &osdmap, + const OSDMapRef &osdmap, const vector& lastup, int lastupprimary, const vector& lastacting,