From: Sage Weil Date: Mon, 17 Apr 2017 14:22:04 +0000 (-0400) Subject: osd/PG: clear past intervals on a osdmap gap X-Git-Tag: v12.0.3~129^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=f9f8f6fda0f76eb554d98c226422f04717a6d6be;p=ceph.git osd/PG: clear past intervals on a osdmap gap If we are crossing an osdmap gap, clear our old past interval since the information is stale: someone else took the pg clean after everything we know if the maps were trimmed. This avoids an assert later in the past intervals check. Signed-off-by: Sage Weil --- diff --git a/src/osd/PG.cc b/src/osd/PG.cc index 76759c0f5767..edfd5d174d79 100644 --- a/src/osd/PG.cc +++ b/src/osd/PG.cc @@ -5164,7 +5164,15 @@ void PG::start_peering_interval( dout(10) << __func__ << ": check_new_interval output: " << debug.str() << dendl; if (new_interval) { - dout(10) << " noting past " << past_intervals.get_bounds().second << dendl; + if (osdmap->get_epoch() == osd->get_superblock().oldest_map && + info.history.last_epoch_clean < osdmap->get_epoch()) { + dout(10) << " map gap, clearing past_intervals and faking" << dendl; + // our information is incomplete and useless; someone else was clean + // after everything we know if osdmaps were trimmed. + past_intervals.clear(); + } else { + dout(10) << " noting past " << past_intervals << dendl; + } dirty_info = true; dirty_big_info = true; info.history.same_interval_since = osdmap->get_epoch();