]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
PG: call start_flush in Active() instead of using do_pending_flush()
authorSamuel Just <sam.just@inktank.com>
Wed, 30 Oct 2013 18:10:24 +0000 (11:10 -0700)
committerSamuel Just <sam.just@inktank.com>
Tue, 19 Nov 2013 18:06:24 +0000 (10:06 -0800)
This way, we don't block an OpWQ thread while waiting on the filestore.

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

index 1e1adbbfc5e2c8e8209f707aca9570895cf2be7c..4f76a5190cd663049795d4b9de8a394d2d319a78 100644 (file)
@@ -167,7 +167,6 @@ PG::PG(OSDService *o, OSDMapRef curmap,
   state(0),
   send_notify(false),
   need_up_thru(false),
-  need_flush(false),
   last_peering_reset(0),
   heartbeat_peer_lock("PG::heartbeat_peer_lock"),
   backfill_target(-1),
@@ -1307,9 +1306,6 @@ void PG::activate(ObjectStore::Transaction& t,
     publish_stats_to_osd();
   }
 
-  // we need to flush this all out before doing anything else..
-  need_flush = true;
-
   // waiters
   if (!is_replay()) {
     requeue_ops(waiting_for_active);
@@ -1318,17 +1314,6 @@ void PG::activate(ObjectStore::Transaction& t,
   on_activate();
 }
 
-void PG::do_pending_flush()
-{
-  assert(is_locked());
-  if (need_flush) {
-    dout(10) << "do_pending_flush doing pending flush" << dendl;
-    osr->flush();
-    need_flush = false;
-    dout(10) << "do_pending_flush done" << dendl;
-  }
-}
-
 bool PG::op_has_sufficient_caps(OpRequestRef op)
 {
   // only check MOSDOp
@@ -5881,6 +5866,10 @@ PG::RecoveryState::Active::Active(my_context ctx)
               *context< RecoveryMachine >().get_on_safe_context_list(),
               *context< RecoveryMachine >().get_query_map(),
               context< RecoveryMachine >().get_info_map());
+  pg->start_flush(
+    context< RecoveryMachine >().get_cur_transaction(),
+    context< RecoveryMachine >().get_on_applied_context_list(),
+    context< RecoveryMachine >().get_on_safe_context_list());
   assert(pg->is_active());
   dout(10) << "Activate Finished" << dendl;
 }
index 06fa042dc8148c36aaddcce63848ba5bcbf8e5d0..7a67df4c350e1787d81caa640fdddc4e5c53dc0f 100644 (file)
@@ -417,8 +417,6 @@ protected:
   // primary-only, recovery-only state
   set<int>             might_have_unfound;  // These osds might have objects on them
                                            // which are unfound on the primary
-  bool need_flush;     // need to flush before any new activity
-
   epoch_t last_peering_reset;
 
 
index e6a85bf62101ae1c78a20bfe948396eb1a75d5e4..5bcc82cdd0d6464c479c05bf98ee3efbf8cbd276 100644 (file)
@@ -825,9 +825,6 @@ void ReplicatedPG::do_request(
   OpRequestRef op,
   ThreadPool::TPHandle &handle)
 {
-  // do any pending flush
-  do_pending_flush();
-
   if (!op_has_sufficient_caps(op)) {
     osd->reply_op_error(op, -EPERM);
     return;