From: David Zafman Date: Tue, 21 Jul 2015 00:48:15 +0000 (-0700) Subject: osd: When generating past intervals due to an import end at pg epoch X-Git-Tag: v0.94.8~22^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=fce79027034bef0cfedbecd9d2601589495f86e6;p=ceph.git osd: When generating past intervals due to an import end at pg epoch Add assert() to make sure same_interval_since isn't too far forward Fixes: #12387 Signed-off-by: David Zafman (cherry picked from commit 65dcc2da76750d0b6dd2cf0031c44f32749f33e5) --- diff --git a/src/osd/PG.cc b/src/osd/PG.cc index 7917638b1e72..da05b804fd86 100644 --- a/src/osd/PG.cc +++ b/src/osd/PG.cc @@ -661,7 +661,7 @@ bool PG::_calc_past_interval_range(epoch_t *start, epoch_t *end, epoch_t oldest_ *end = info.history.same_interval_since; } else { // PG must be imported, so let's calculate the whole range. - *end = osd->get_superblock().newest_map; + *end = osdmap_ref->get_epoch(); } // Do we already have the intervals we want? diff --git a/src/osd/osd_types.cc b/src/osd/osd_types.cc index 52214a51f359..b13925c6ea0f 100644 --- a/src/osd/osd_types.cc +++ b/src/osd/osd_types.cc @@ -2710,6 +2710,7 @@ bool pg_interval_t::check_new_interval( pg_interval_t& i = (*past_intervals)[same_interval_since]; i.first = same_interval_since; i.last = osdmap->get_epoch() - 1; + assert(i.first <= i.last); i.acting = old_acting; i.up = old_up; i.primary = old_acting_primary;