diff --git a/src/osd/PG.cc b/src/osd/PG.cc index 1e1adbbfc5e2c..4f76a5190cd66 100644 --- a/src/osd/PG.cc +++ b/src/osd/PG.cc @@ -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; } diff --git a/src/osd/PG.h b/src/osd/PG.h index 06fa042dc8148..7a67df4c350e1 100644 --- a/src/osd/PG.h +++ b/src/osd/PG.h @@ -417,8 +417,6 @@ class PG { // primary-only, recovery-only state set 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; diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc index e6a85bf62101a..5bcc82cdd0d64 100644 --- a/src/osd/ReplicatedPG.cc +++ b/src/osd/ReplicatedPG.cc @@ -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;