]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: allow multiple threads to block on wait_min_pg_epoch
authorSage Weil <sage@redhat.com>
Mon, 9 Jul 2018 21:06:57 +0000 (16:06 -0500)
committerSage Weil <sage@redhat.com>
Fri, 7 Sep 2018 17:07:56 +0000 (12:07 -0500)
Signed-off-by: Sage Weil <sage@redhat.com>
src/osd/OSD.cc
src/osd/OSD.h

index 963afe89847e48686893350d2442b0f6e83252b0..52b345aed10ad6f531ba63307d2c73a145322e9b 100644 (file)
@@ -9460,14 +9460,14 @@ epoch_t OSDShard::get_min_pg_epoch()
 void OSDShard::wait_min_pg_epoch(epoch_t need)
 {
   Mutex::Locker l(shard_lock);
-  waiting_for_min_pg_epoch = true;
+  ++waiting_for_min_pg_epoch;
   while (!pg_slots_by_epoch.empty() &&
         pg_slots_by_epoch.begin()->epoch < need) {
     dout(10) << need << " waiting on "
             << pg_slots_by_epoch.begin()->epoch << dendl;
     min_pg_epoch_cond.Wait(shard_lock);
   }
-  waiting_for_min_pg_epoch = false;
+  --waiting_for_min_pg_epoch;
 }
 
 epoch_t OSDShard::get_max_waiting_epoch()
index 982bb1c1bb78f57c642162d1f190d27bd3850dd9..c92b1bb8d7adfe8a7800ae44944546a47b30eb25 100644 (file)
@@ -1140,7 +1140,7 @@ struct OSDShard {
       boost::intrusive::set_member_hook<>,
       &OSDShardPGSlot::pg_epoch_item>,
     boost::intrusive::compare<pg_slot_compare_by_epoch>> pg_slots_by_epoch;
-  bool waiting_for_min_pg_epoch = false;
+  int waiting_for_min_pg_epoch = 0;
   Cond min_pg_epoch_cond;
 
   /// priority queue