]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: use parent pgid (as appropriate) in generate_past_intervals()
authorSage Weil <sage@inktank.com>
Fri, 18 Apr 2014 22:48:33 +0000 (15:48 -0700)
committerSage Weil <sage@inktank.com>
Tue, 22 Apr 2014 04:26:07 +0000 (21:26 -0700)
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 <sage@inktank.com>
src/osd/PG.cc

index 7dd0acae8c2b5f20919e24652f0cc675eec5ed7d..32a7becd5b9d8a50aeea68c1888b8584e594c38c 100644 (file)
@@ -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) {