]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon/PGMonitor: fix force_create_pg
authorSage Weil <sage@redhat.com>
Tue, 31 Jan 2017 17:31:42 +0000 (12:31 -0500)
committerShinobu Kinjo <shinobu@redhat.com>
Fri, 3 Mar 2017 23:33:49 +0000 (08:33 +0900)
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>
(cherry picked from commit 9a41a0b7289fa59f4b747a63e152e88af6e8abd5)

Conflicts:
src/mon/PGMonitor.cc

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 0baeb86639b75b0fa45a2d7c00395a40f1233d50..6b9529d6cd8df442c684d0941c45b384d6ee2ac6 100644 (file)
@@ -1430,10 +1430,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(g_ceph_context);
+      PGMapUpdater::register_pg(
+       mon->osdmon()->osdmap,
+       pgid,
+       epoch,
+       true,
+       &pg_map,
+       &pending_inc);
     }
     ss << "pg " << pgidstr << " now creating, ok";
     goto update;