From 5562e26e655ce2937169083e89a821e7dbb8a3fc Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Fri, 18 Apr 2014 15:48:33 -0700 Subject: [PATCH] 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 --- src/osd/PG.cc | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/osd/PG.cc b/src/osd/PG.cc index 7dd0acae8c2b5..32a7becd5b9d8 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) { -- 2.39.5