]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: fix PG::ch init
authorSage Weil <sage@redhat.com>
Fri, 9 Feb 2018 19:13:07 +0000 (13:13 -0600)
committerSage Weil <sage@redhat.com>
Wed, 4 Apr 2018 13:26:53 +0000 (08:26 -0500)
Signed-off-by: Sage Weil <sage@redhat.com>
src/osd/OSD.cc

index 3ed8e161ec07126aad02cd2ca68f2221cbafd2e4..5f8ade3e6ff50c262e63a650217b723cbfb96af6 100644 (file)
@@ -3911,6 +3911,7 @@ PGRef OSD::handle_pg_create_info(OSDMapRef osdmap, const PGCreateInfo *info)
   }
 
   PGRef pg = _open_pg(createmap, pgid);
+  pg->ch = store->create_new_collection(pg->coll);
 
   pg->lock(true);
 
@@ -8011,13 +8012,13 @@ void OSD::split_pgs(
     PG* child = _make_pg(nextmap, *i);
     child->lock(true);
     out_pgs->insert(child);
+    child->ch = store->create_new_collection(child->coll);
     rctx->created_pgs.insert(child);
 
     unsigned split_bits = i->get_split_bits(pg_num);
-    dout(10) << "pg_num is " << pg_num << dendl;
-    dout(10) << "m_seed " << i->ps() << dendl;
-    dout(10) << "split_bits is " << split_bits << dendl;
-
+    dout(10) << " pg_num is " << pg_num
+            << ", m_seed " << i->ps()
+            << ", split_bits is " << split_bits << dendl;
     parent->split_colls(
       *i,
       split_bits,
@@ -8029,7 +8030,6 @@ void OSD::split_pgs(
       child,
       split_bits);
 
-    child->ch = store->create_new_collection(child->coll);
     child->finish_split_stats(*stat_iter, rctx->transaction);
     child->unlock();
   }
@@ -8163,10 +8163,6 @@ void OSD::dispatch_context_transaction(PG::RecoveryCtx &ctx, PG *pg,
       std::move(*ctx.transaction), TrackedOpRef(), handle);
     assert(tr == 0);
     delete (ctx.transaction);
-    for (auto pg : ctx.created_pgs) {
-      pg->ch = store->open_collection(pg->coll);
-      assert(pg->ch);
-    }
     ctx.created_pgs.clear();
     ctx.transaction = new ObjectStore::Transaction;
     ctx.on_applied = new C_Contexts(cct);
@@ -8207,10 +8203,6 @@ void OSD::dispatch_context(PG::RecoveryCtx &ctx, PG *pg, OSDMapRef curmap,
       pg->ch,
       std::move(*ctx.transaction), TrackedOpRef(),
       handle);
-    for (auto pg : ctx.created_pgs) {
-      pg->ch = store->open_collection(pg->coll);
-      assert(pg->ch);
-    }
     ctx.created_pgs.clear();
     delete (ctx.transaction);
     assert(tr == 0);