summaryrefslogtreecommitdiffstats
path: root/src/osd
diff options
context:
space:
mode:
authorDavid Zafman <dzafman@redhat.com>2015-07-21 02:48:15 +0200
committerDavid Zafman <dzafman@redhat.com>2015-09-02 21:40:07 +0200
commit65dcc2da76750d0b6dd2cf0031c44f32749f33e5 (patch)
treec3c48623f9fed942b5c7a96ad7ad2971e8ce217a /src/osd
parentMerge pull request #5291 from zhouyuan/rgw_s3_obj_version (diff)
downloadceph-65dcc2da76750d0b6dd2cf0031c44f32749f33e5.tar.xz
ceph-65dcc2da76750d0b6dd2cf0031c44f32749f33e5.zip
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 <dzafman@redhat.com>
Diffstat (limited to 'src/osd')
-rw-r--r--src/osd/PG.cc2
-rw-r--r--src/osd/osd_types.cc1
2 files changed, 2 insertions, 1 deletions
diff --git a/src/osd/PG.cc b/src/osd/PG.cc
index b53370f8c38..edf91721be8 100644
--- a/src/osd/PG.cc
+++ b/src/osd/PG.cc
@@ -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?
diff --git a/src/osd/osd_types.cc b/src/osd/osd_types.cc
index 4bc95e4dd18..bec9f0ded6b 100644
--- a/src/osd/osd_types.cc
+++ b/src/osd/osd_types.cc
@@ -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;