]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
pg: track who we are waiting for maps from
authorMike Ryan <mike.ryan@inktank.com>
Wed, 27 Jun 2012 20:30:45 +0000 (13:30 -0700)
committerSamuel Just <sam.just@inktank.com>
Fri, 6 Jul 2012 20:45:04 +0000 (13:45 -0700)
Signed-off-by: Mike Ryan <mike.ryan@inktank.com>
src/osd/PG.cc
src/osd/PG.h
src/osd/ReplicatedPG.cc

index 132c9266e3bcf3615570d30254ad81053e85c358..a7479d3c78b74920621743c88b699a398b87c350 100644 (file)
@@ -2631,6 +2631,7 @@ void PG::sub_op_scrub_map(OpRequestRef op)
   }
 
   --scrub_waiting_on;
+  scrub_waiting_on_whom.erase(from);
   if (scrub_waiting_on == 0) {
     if (finalizing_scrub) { // incremental lists received
       osd->scrub_finalize_wq.queue(this);
@@ -2640,6 +2641,7 @@ void PG::sub_op_scrub_map(OpRequestRef op)
         finalizing_scrub = true;
         scrub_gather_replica_maps();
         ++scrub_waiting_on;
+        scrub_waiting_on_whom.insert(osd->whoami);
         osd->scrub_wq.queue(this);
       }
     }
@@ -3032,6 +3034,7 @@ void PG::scrub()
      * last_update_applied == info.last_update)
      */
     scrub_waiting_on = acting.size();
+    scrub_waiting_on_whom.insert(acting.begin(), acting.end());
 
     // request maps from replicas
     for (unsigned i=1; i<acting.size(); i++) {
@@ -3051,6 +3054,7 @@ void PG::scrub()
     }
 
     --scrub_waiting_on;
+    scrub_waiting_on_whom.erase(osd->whoami);
 
     if (scrub_waiting_on == 0) {
       // the replicas have completed their scrub map, so lock out writes
@@ -3072,6 +3076,7 @@ void PG::scrub()
     // request incrementals from replicas
     scrub_gather_replica_maps();
     ++scrub_waiting_on;
+    scrub_waiting_on_whom.insert(osd->whoami);
   }
     
   dout(10) << "clean up scrub" << dendl;
@@ -3094,6 +3099,7 @@ void PG::scrub()
   }
   
   --scrub_waiting_on;
+  scrub_waiting_on_whom.erase(osd->whoami);
   if (scrub_waiting_on == 0) {
     assert(last_update_applied == info.last_update);
     osd->scrub_finalize_wq.queue(this);
@@ -3117,6 +3123,8 @@ void PG::scrub_clear_state()
   finalizing_scrub = false;
   scrub_block_writes = false;
   scrub_active = false;
+  scrub_waiting_on = 0;
+  scrub_waiting_on_whom.clear();
   if (active_rep_scrub) {
     active_rep_scrub->put();
     active_rep_scrub = NULL;
@@ -3134,6 +3142,7 @@ bool PG::scrub_gather_replica_maps() {
     
     if (scrub_received_maps[p->first].valid_through != log.head) {
       scrub_waiting_on++;
+      scrub_waiting_on_whom.insert(p->first);
       // Need to request another incremental map
       _request_scrub_map(p->first, p->second.valid_through);
     }
index e7837a4f545fa413893b7116eeffaba28fe7c4a1..b915121183df1d30b5ae7f399a4f98d75271e5bd 100644 (file)
@@ -741,6 +741,7 @@ public:
   bool scrub_active;
   bool scrub_reserved, scrub_reserve_failed;
   int scrub_waiting_on;
+  set<int> scrub_waiting_on_whom;
   epoch_t scrub_epoch_start;
   ScrubMap primary_scrubmap;
   MOSDRepScrub *active_rep_scrub;
index fe090f3f3409c455c69414c15363ba82755bd5a2..608443ddc436b114b032a3e582a200caf517963d 100644 (file)
@@ -3413,6 +3413,7 @@ void ReplicatedPG::op_applied(RepGather *repop)
     finalizing_scrub = true;
     scrub_gather_replica_maps();
     ++scrub_waiting_on;
+    scrub_waiting_on_whom.insert(osd->whoami);
     osd->scrub_wq.queue(this);
   }