]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: calculate initial PG mapping from PG's osdmap
authorSage Weil <sage@inktank.com>
Mon, 21 Jan 2013 00:11:10 +0000 (16:11 -0800)
committerSage Weil <sage@inktank.com>
Mon, 21 Jan 2013 00:11:10 +0000 (16:11 -0800)
The initial values of up/acting need to be based on the PG's osdmap, not
the OSD's latest.  This can cause various confusion in
pg_interval_t::check_new_interval() when calling OSDMap methods due to the
up/acting OSDs not existing yet (for example).

Fixes: #3879
Reported-by: Jens Kristian S?gaard <jens@mermaidconsulting.dk>
Tested-by: Jens Kristian S?gaard <jens@mermaidconsulting.dk>
Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Samuel Just <sam.just@inktank.com>
src/osd/OSD.cc

index d0236e06419499b081e346f5deb26544fe088bb6..a805d659758abce3067389a4f01b4a2c20bfdb5d 100644 (file)
@@ -1531,9 +1531,9 @@ void OSD::load_pgs()
 
     service.reg_last_pg_scrub(pg->info.pgid, pg->info.history.last_scrub_stamp);
 
-    // generate state for current mapping
-    osdmap->pg_to_up_acting_osds(pgid, pg->up, pg->acting);
-    int role = osdmap->calc_pg_role(whoami, pg->acting);
+    // generate state for PG's current mapping
+    pg->get_osdmap()->pg_to_up_acting_osds(pgid, pg->up, pg->acting);
+    int role = pg->get_osdmap()->calc_pg_role(whoami, pg->acting);
     pg->set_role(role);
 
     PG::RecoveryCtx rctx(0, 0, 0, 0, 0, 0);