]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon/PGMonitor: fix force_create_pg 12539/head
authorSage Weil <sage@redhat.com>
Tue, 31 Jan 2017 17:31:42 +0000 (12:31 -0500)
committerSage Weil <sage@redhat.com>
Mon, 6 Feb 2017 14:32:52 +0000 (09:32 -0500)
We weren't carefully registering the creating PG.  In
particular, the current osd mappings (acting, up, etc.)
weren't getting filled in, which meant the PG wasn't
(necessarily) mapped to an OSD until the OSDMap updated
and we recalculated mappings.

Fix by sending us through the common code path so that
all fields get updated properly.

Fixes: http://tracker.ceph.com/issues/18298
Signed-off-by: Sage Weil <sage@redhat.com>
src/mon/PGMap.h
src/mon/PGMonitor.cc

index 7787d6cbb02e36d63b8d01e679529ae88dd45100..1c86ab3afffdb9e24440aeec6ffc660ee2b1bb83 100644 (file)
@@ -412,7 +412,6 @@ public:
       PGMap *pg_map,
       PGMap::Incremental *pending_inc);
 
-protected:
   static void register_pg(
       const OSDMap &osd_map,
       pg_t pgid, epoch_t epoch,
index 13e342b2bf5f3a67bb8822ddb7fa32d3fc218d3b..d1c241e37009c9e50b7f5c77edfec302a9f18942 100644 (file)
@@ -1381,10 +1381,13 @@ bool PGMonitor::prepare_command(MonOpRequestRef op)
       goto reply;
     }
     {
-      pg_stat_t& s = pending_inc.pg_stat_updates[pgid];
-      s.state = PG_STATE_CREATING;
-      s.created = epoch;
-      s.last_change = ceph_clock_now();
+      PGMapUpdater::register_pg(
+       mon->osdmon()->osdmap,
+       pgid,
+       epoch,
+       true,
+       &pg_map,
+       &pending_inc);
     }
     ss << "pg " << pgidstr << " now creating, ok";
     goto update;