]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: When generating past intervals due to an import end at pg epoch 5780/head
authorDavid Zafman <dzafman@redhat.com>
Tue, 21 Jul 2015 00:48:15 +0000 (17:48 -0700)
committerDavid Zafman <dzafman@redhat.com>
Wed, 2 Sep 2015 19:40:07 +0000 (12:40 -0700)
Add assert() to make sure same_interval_since isn't too far forward

Fixes: #12387
Signed-off-by: David Zafman <dzafman@redhat.com>
src/osd/PG.cc
src/osd/osd_types.cc

index b53370f8c38d98f4c1d4f4f69eabd5032cd9d01a..edf91721be80b8f66d8f3890af8d965068be24af 100644 (file)
@@ -647,7 +647,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?
index 4bc95e4dd1852083c640fdbf9873b8b1ac9861ef..bec9f0ded6b3a36289d321254d94145143e0dcc5 100644 (file)
@@ -2652,6 +2652,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;