]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/PG: clear past intervals on a osdmap gap
authorSage Weil <sage@redhat.com>
Mon, 17 Apr 2017 14:22:04 +0000 (10:22 -0400)
committerSage Weil <sage@redhat.com>
Fri, 28 Apr 2017 15:32:17 +0000 (11:32 -0400)
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 <sage@redhat.com>
src/osd/PG.cc

index 76759c0f5767b38d9f26e99a086ce7d920127ae3..edfd5d174d79534e181bc662086426561608740a 100644 (file)
@@ -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();