From: Sage Weil Date: Fri, 9 Feb 2018 21:58:15 +0000 (-0600) Subject: osd/PG: register flush completions directly on the Transaction X-Git-Tag: v13.1.0~390^2~64 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=a5494b815c18b3bb51d70e663e2b5eb4a667558e;p=ceph.git osd/PG: register flush completions directly on the Transaction No need to awkward list passed as an arg; all of these callbacks end up on the Transaction anyway. Signed-off-by: Sage Weil --- diff --git a/src/osd/PG.cc b/src/osd/PG.cc index 6dfeb9adf3db9..9c7abe989217c 100644 --- a/src/osd/PG.cc +++ b/src/osd/PG.cc @@ -5777,17 +5777,15 @@ struct FlushState { }; typedef ceph::shared_ptr FlushStateRef; -void PG::start_flush(ObjectStore::Transaction *t, - list *on_applied, - list *on_safe) +void PG::start_flush(ObjectStore::Transaction *t) { // flush in progress ops FlushStateRef flush_trigger (std::make_shared( this, get_osdmap()->get_epoch())); t->nop(); flushes_in_progress++; - on_applied->push_back(new ContainerContext(flush_trigger)); - on_safe->push_back(new ContainerContext(flush_trigger)); + t->register_on_applied(new ContainerContext(flush_trigger)); + t->register_on_commit(new ContainerContext(flush_trigger)); } void PG::reset_interval_flush() @@ -7821,10 +7819,7 @@ PG::RecoveryState::Active::Active(my_context ctx) assert(!pg->backfill_reserved); assert(pg->is_primary()); ldout(pg->cct, 10) << "In Active, about to call activate" << dendl; - pg->start_flush( - context< RecoveryMachine >().get_cur_transaction(), - context< RecoveryMachine >().get_on_applied_context_list(), - context< RecoveryMachine >().get_on_safe_context_list()); + pg->start_flush(context< RecoveryMachine >().get_cur_transaction()); pg->activate(*context< RecoveryMachine >().get_cur_transaction(), pg->get_osdmap()->get_epoch(), *context< RecoveryMachine >().get_on_safe_context_list(), @@ -8235,10 +8230,7 @@ PG::RecoveryState::ReplicaActive::ReplicaActive(my_context ctx) context< RecoveryMachine >().log_enter(state_name); PG *pg = context< RecoveryMachine >().pg; - pg->start_flush( - context< RecoveryMachine >().get_cur_transaction(), - context< RecoveryMachine >().get_on_applied_context_list(), - context< RecoveryMachine >().get_on_safe_context_list()); + pg->start_flush(context< RecoveryMachine >().get_cur_transaction()); } @@ -8344,10 +8336,7 @@ PG::RecoveryState::Stray::Stray(my_context ctx) ldout(pg->cct,10) << __func__ << " pool is deleted" << dendl; post_event(DeleteStart()); } else { - pg->start_flush( - context< RecoveryMachine >().get_cur_transaction(), - context< RecoveryMachine >().get_on_applied_context_list(), - context< RecoveryMachine >().get_on_safe_context_list()); + pg->start_flush(context< RecoveryMachine >().get_cur_transaction()); } } @@ -8786,10 +8775,7 @@ boost::statechart::result PG::RecoveryState::GetLog::react(const GotLog&) msg->info, msg->log, msg->missing, auth_log_shard); } - pg->start_flush( - context< RecoveryMachine >().get_cur_transaction(), - context< RecoveryMachine >().get_on_applied_context_list(), - context< RecoveryMachine >().get_on_safe_context_list()); + pg->start_flush(context< RecoveryMachine >().get_cur_transaction()); return transit< GetMissing >(); } diff --git a/src/osd/PG.h b/src/osd/PG.h index bc583ac074392..b269065acaf90 100644 --- a/src/osd/PG.h +++ b/src/osd/PG.h @@ -2915,9 +2915,7 @@ protected: ObjectStore::Transaction *t); void on_new_interval(); virtual void _on_new_interval() = 0; - void start_flush(ObjectStore::Transaction *t, - list *on_applied, - list *on_safe); + void start_flush(ObjectStore::Transaction *t); void set_last_peering_reset(); void update_history(const pg_history_t& history);