]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/PG: hide peering_queue from OSD
authorSage Weil <sage@redhat.com>
Sun, 17 Sep 2017 22:02:05 +0000 (17:02 -0500)
committerSage Weil <sage@redhat.com>
Fri, 6 Oct 2017 18:08:18 +0000 (13:08 -0500)
Signed-off-by: Sage Weil <sage@redhat.com>
src/osd/OSD.cc
src/osd/PG.cc
src/osd/PG.h

index 2fe63d060e994a73045910ebf43db3e060136052..9cbce15c9b5355b35eb2acdd98e5b1aae73fc8e6 100644 (file)
@@ -9110,15 +9110,11 @@ void OSD::process_peering_events(
       // handle an event
       peering_wq.queue(pg);
     } else {
-      assert(!pg->peering_queue.empty());
-      PG::CephPeeringEvtRef evt = pg->peering_queue.front();
-      pg->peering_queue.pop_front();
-      pg->handle_peering_event(evt, &rctx);
+      pg->process_peering_event(&rctx);
     }
     need_up_thru = pg->need_up_thru || need_up_thru;
     same_interval_since = MAX(pg->info.history.same_interval_since,
                              same_interval_since);
-    pg->write_if_dirty(*rctx.transaction);
     if (!split_pgs.empty()) {
       rctx.on_applied->add(new C_CompleteSplits(this, split_pgs));
       split_pgs.clear();
index 946c5147f9991810fde8950db3ce8d59f6bfdf8f..ba8e17315028b325299f590ffdfa26d0a2ce92a2 100644 (file)
@@ -5644,9 +5644,13 @@ void PG::take_waiters()
                       peering_waiters.begin(), peering_waiters.end());
 }
 
-void PG::handle_peering_event(CephPeeringEvtRef evt, RecoveryCtx *rctx)
+void PG::process_peering_event(RecoveryCtx *rctx)
 {
-  dout(10) << "handle_peering_event: " << evt->get_desc() << dendl;
+  assert(!peering_queue.empty());
+  CephPeeringEvtRef evt = peering_queue.front();
+  peering_queue.pop_front();
+
+  dout(10) << __func__ << ": " << evt->get_desc() << dendl;
   if (!have_same_or_newer_map(evt->get_epoch_sent())) {
     dout(10) << "deferring event " << evt->get_desc() << dendl;
     peering_waiters.push_back(evt);
@@ -5655,6 +5659,7 @@ void PG::handle_peering_event(CephPeeringEvtRef evt, RecoveryCtx *rctx)
   if (old_peering_evt(evt))
     return;
   recovery_state.handle_event(evt, rctx);
+  write_if_dirty(*rctx->transaction);
 }
 
 void PG::queue_peering_event(CephPeeringEvtRef evt)
@@ -5745,7 +5750,10 @@ void PG::handle_activate_map(RecoveryCtx *rctx)
             << last_persisted_osdmap_ref->get_epoch()
             << " while current is " << osdmap_ref->get_epoch() << dendl;
   }
-  if (osdmap_ref->check_new_blacklist_entries()) check_blacklisted_watchers();
+  if (osdmap_ref->check_new_blacklist_entries()) {
+    check_blacklisted_watchers();
+  }
+  write_if_dirty(*rctx->transaction);
 }
 
 void PG::handle_loaded(RecoveryCtx *rctx)
index da676e8e82f2554bfdfc26e52f5d79e4b394a37d..f37707e3f4912c3ac89f5fb1d8e6ba676687688b 100644 (file)
@@ -393,7 +393,7 @@ public:
   void set_force_backfill(bool b);
 
   void queue_peering_event(CephPeeringEvtRef evt);
-  void handle_peering_event(CephPeeringEvtRef evt, RecoveryCtx *rctx);
+  void process_peering_event(RecoveryCtx *rctx);
   void queue_query(epoch_t msg_epoch, epoch_t query_epoch,
                   pg_shard_t from, const pg_query_t& q);
   void queue_null(epoch_t msg_epoch, epoch_t query_epoch);