]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
PGMonitor,OSD: don't send creates on split
authorSamuel Just <sam.just@inktank.com>
Wed, 12 Sep 2012 16:38:05 +0000 (09:38 -0700)
committerSamuel Just <sam.just@inktank.com>
Wed, 5 Dec 2012 19:34:18 +0000 (11:34 -0800)
Splits will be handled when the map update effecting the split is
processed for the splitting pg on each OSD.  This will mesh
with the pg history which will place the new pg at the current
positions of the splitting pg.

Signed-off-by: Samuel Just <sam.just@inktank.com>
src/mon/PGMonitor.cc
src/osd/OSD.cc
src/osd/OSD.h

index 6a6dd60b84b16b6a34487663c77662d48d4cb0b3..3f63905f13b979395b3a919bf8684fbb8118fd63 100644 (file)
@@ -783,6 +783,10 @@ void PGMonitor::send_pg_creates()
     if (pgid.preferred() >= 0)
       continue;
 
+    // don't send creates for splits
+    if (s.parent_split_bits)
+      continue;
+
     if (nrep) {
       pg_map.creating_pgs_by_osd[acting[0]].insert(pgid);
     } else {
index 61471b439e507a7c8e046b8204f209ca4cf435d8..27d6829bdf1962d0be1a04aac725abc444de1ec4 100644 (file)
@@ -4325,11 +4325,6 @@ bool OSD::can_create_pg(pg_t pgid)
     return false;
   }
 
-  if (creating_pgs[pgid].split_bits) {
-    dout(10) << "can_create_pg " << pgid << " - split" << dendl;
-    return false;
-  }
-
   dout(10) << "can_create_pg " << pgid << " - can create now" << dendl;
   return true;
 }
@@ -4534,7 +4529,8 @@ void OSD::handle_pg_create(OpRequestRef op)
     pg_t pgid = p->first;
     epoch_t created = p->second.created;
     pg_t parent = p->second.parent;
-    int split_bits = p->second.split_bits;
+    if (p->second.split_bits) // Skip split pgs
+      continue;
     pg_t on = pgid;
 
     if (pgid.preferred() >= 0) {
@@ -4542,13 +4538,7 @@ void OSD::handle_pg_create(OpRequestRef op)
       continue;
     }
 
-    if (split_bits) {
-      on = parent;
-      dout(20) << "mkpg " << pgid << " e" << created << " from parent " << parent
-              << " split by " << split_bits << " bits" << dendl;
-    } else {
-      dout(20) << "mkpg " << pgid << " e" << created << dendl;
-    }
+    dout(20) << "mkpg " << pgid << " e" << created << dendl;
    
     // is it still ours?
     vector<int> up, acting;
@@ -4572,12 +4562,6 @@ void OSD::handle_pg_create(OpRequestRef op)
       continue;
     }
 
-    // does parent exist?
-    if (split_bits && !_have_pg(parent)) {
-      dout(10) << "mkpg " << pgid << "  missing parent " << parent << ", skipping" << dendl;
-      continue;
-    }
-
     // figure history
     pg_history_t history;
     history.epoch_created = created;
@@ -4587,7 +4571,6 @@ void OSD::handle_pg_create(OpRequestRef op)
     // register.
     creating_pgs[pgid].history = history;
     creating_pgs[pgid].parent = parent;
-    creating_pgs[pgid].split_bits = split_bits;
     creating_pgs[pgid].acting.swap(acting);
     calc_priors_during(pgid, created, history.same_interval_since, 
                       creating_pgs[pgid].prior);
index edbb30d5fbbc964f8896bf7c4d6bf15c6b0fc389..ba0da042a31e9e2a884a8cee4e9a54387097cb4a 100644 (file)
@@ -837,7 +837,6 @@ protected:
     vector<int> acting;
     set<int> prior;
     pg_t parent;
-    int split_bits;
   };
   hash_map<pg_t, create_pg_info> creating_pgs;
   double debug_drop_pg_create_probability;