From: Sage Weil Date: Fri, 18 Apr 2014 22:48:33 +0000 (-0700) Subject: osd: use parent pgid (as appropriate) in generate_past_intervals() X-Git-Tag: v0.80-rc1~3^2~4 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=5562e26e655ce2937169083e89a821e7dbb8a3fc;p=ceph.git osd: use parent pgid (as appropriate) in generate_past_intervals() Feed in the ancestor pg_t (if any) when we are looking at intervals for previous maps that may have preceded a recent split. Fixes: #8139 Signed-off-by: Sage Weil --- diff --git a/src/osd/PG.cc b/src/osd/PG.cc index 7dd0acae8c2b..32a7becd5b9d 100644 --- a/src/osd/PG.cc +++ b/src/osd/PG.cc @@ -654,8 +654,10 @@ void PG::generate_past_intervals() old_acting.swap(acting); cur_map = osd->get_map(cur_epoch); - cur_map->pg_to_up_acting_osds( - get_pgid().pgid, &up, 0, &acting, &primary); + pg_t pgid = get_pgid().pgid; + if (cur_map->get_pools().count(pgid.pool())) + pgid = pgid.get_ancestor(cur_map->get_pg_num(pgid.pool())); + cur_map->pg_to_up_acting_osds(pgid, &up, 0, &acting, &primary); std::stringstream debug; bool new_interval = pg_interval_t::check_new_interval( @@ -669,8 +671,8 @@ void PG::generate_past_intervals() info.history.last_epoch_clean, cur_map, last_map, - info.pgid.pool(), - info.pgid.pgid, + pgid.pool(), + pgid, &past_intervals, &debug); if (new_interval) {