]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
jewel: mon: fix force_pg_create pg stuck in creating bug 17008/head
authorAlexey Sheplyakov <asheplyakov@yandex.ru>
Sun, 13 Aug 2017 12:33:00 +0000 (16:33 +0400)
committerAlexey Sheplyakov <asheplyakov@yandex.ru>
Sun, 13 Aug 2017 14:37:49 +0000 (18:37 +0400)
Register the creating PG through the common path to get the PG mapped to an OSD.
Adapted from 9a41a0b7289fa59f4b747a63e152e88af6e8abd5

Fixes: http://tracker.ceph.com/issues/19182
Signed-off-by: Alexey Sheplyakov <asheplyakov@yandex.ru>
src/mon/PGMonitor.cc
src/mon/PGMonitor.h

index 9ff5d48fb7829d94131a141f30ed9dc711e3a61a..6381911ee96aa1240baa6b8192f258d8624f6563 100644 (file)
@@ -958,7 +958,7 @@ void PGMonitor::check_osd_map(epoch_t epoch)
 }
 
 void PGMonitor::register_pg(OSDMap *osdmap,
-                            pg_pool_t& pool, pg_t pgid, epoch_t epoch,
+                            pg_t pgid, epoch_t epoch,
                             bool new_pool)
 {
   pg_t parent;
@@ -968,7 +968,7 @@ void PGMonitor::register_pg(OSDMap *osdmap,
     parent = pgid;
     while (1) {
       // remove most significant bit
-      int msb = pool.calc_bits_of(parent.ps());
+      int msb = pg_pool_t::calc_bits_of(parent.ps());
       if (!msb)
        break;
       parent.set_ps(parent.ps() & ~(1<<(msb-1)));
@@ -1078,7 +1078,7 @@ bool PGMonitor::register_new_pgs()
        continue;
       }
       created++;
-      register_pg(osdmap, pool, pgid, pool.get_last_change(), new_pool);
+      register_pg(osdmap, pgid, pool.get_last_change(), new_pool);
     }
   }
 
@@ -1979,10 +1979,7 @@ 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);
+      register_pg(&mon->osdmon()->osdmap, pgid, epoch, true);
     }
     ss << "pg " << pgidstr << " now creating, ok";
     goto update;
index 893099387f3a3e21e106f9f5c2aefe55f92b2839..989cfba90970a42e9e815464fba7172cca21e06f 100644 (file)
@@ -112,7 +112,7 @@ private:
   // when we last received PG stats from each osd
   map<int,utime_t> last_osd_report;
 
-  void register_pg(OSDMap *osdmap, pg_pool_t& pool, pg_t pgid,
+  void register_pg(OSDMap *osdmap, pg_t pgid,
                   epoch_t epoch, bool new_pool);
 
   /**