]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: Get pgid ancestor from last_map when building past intervals 4214/head
authorDavid Zafman <dzafman@redhat.com>
Thu, 9 Oct 2014 18:20:13 +0000 (11:20 -0700)
committerLoic Dachary <ldachary@redhat.com>
Mon, 30 Mar 2015 09:05:05 +0000 (11:05 +0200)
Fixed OSD::build_past_intervals_parallel() and PG::generate_past_intervals()

Fixes: #10430
Signed-off-by: David Zafman <dzafman@redhat.com>
(cherry picked from commit 0c5b66da7a9ba516340d06d9e806beb9d1040d0e)

src/osd/OSD.cc
src/osd/PG.cc

index 0752e8eef0d7cabeb9eac641b7b15756d456c13f..e71f9560dc26c8bbe9cf9b2ae753de1e79f4a35f 100644 (file)
@@ -3046,8 +3046,11 @@ void OSD::build_past_intervals_parallel()
       vector<int> acting, up;
       int up_primary;
       int primary;
+      pg_t pgid = pg->info.pgid.pgid;
+      if (p.same_interval_since && last_map->get_pools().count(pgid.pool()))
+       pgid = pgid.get_ancestor(last_map->get_pg_num(pgid.pool()));
       cur_map->pg_to_up_acting_osds(
-       pg->info.pgid.pgid, &up, &up_primary, &acting, &primary);
+       pgid, &up, &up_primary, &acting, &primary);
 
       if (p.same_interval_since == 0) {
        dout(10) << __func__ << " epoch " << cur_epoch << " pg " << pg->info.pgid
@@ -3073,7 +3076,7 @@ void OSD::build_past_intervals_parallel()
        p.same_interval_since,
        pg->info.history.last_epoch_clean,
        cur_map, last_map,
-       pg->info.pgid.pgid,
+       pgid,
        &pg->past_intervals,
        &debug);
       if (new_interval) {
index 7b454b3020d1ef4b1bf947ed5d7f5faaad07e27c..92c0549d33a486183893618f37ee8b200b4472f1 100644 (file)
@@ -671,8 +671,8 @@ void PG::generate_past_intervals()
 
     cur_map = osd->get_map(cur_epoch);
     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()));
+    if (last_map->get_pools().count(pgid.pool()))
+      pgid = pgid.get_ancestor(last_map->get_pg_num(pgid.pool()));
     cur_map->pg_to_up_acting_osds(pgid, &up, &up_primary, &acting, &primary);
 
     std::stringstream debug;