OSD: account for split in project_pg_history

split causes a new interval.

Signed-off-by: Samuel Just <sam.just@inktank.com>
This commit is contained in:
Samuel Just 2012-11-28 17:14:11 -08:00
parent 15d899370f
commit 9f169ac0f5

View File

@ -1796,6 +1796,7 @@ void OSD::project_pg_history(pg_t pgid, pg_history_t& h, epoch_t from,
e--) {
// verify during intermediate epoch (e-1)
OSDMapRef oldmap = get_map(e-1);
assert(oldmap->have_pg_pool(pgid.pool()));
vector<int> up, acting;
oldmap->pg_to_up_acting_osds(pgid, up, acting);
@ -1808,6 +1809,12 @@ void OSD::project_pg_history(pg_t pgid, pg_history_t& h, epoch_t from,
<< dendl;
h.same_interval_since = e;
}
// split?
if (pgid.is_split(oldmap->get_pg_num(pgid.pool()),
osdmap->get_pg_num(pgid.pool()),
0)) {
h.same_interval_since = e;
}
// up set change?
if (up != currentup && e > h.same_up_since) {
dout(15) << "project_pg_history " << pgid << " up changed in " << e