From: Sage Weil Date: Sun, 17 Sep 2017 22:37:36 +0000 (-0500) Subject: osd/PG: move write_if_dirty inside handle_{loaded,create} X-Git-Tag: v13.0.1~634^2~28 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=fa7818aefa92b4e9e067945c33f96d520e885f4e;p=ceph-ci.git osd/PG: move write_if_dirty inside handle_{loaded,create} Signed-off-by: Sage Weil --- diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc index f64667a6f91..2ee9b5130b7 100644 --- a/src/osd/OSD.cc +++ b/src/osd/OSD.cc @@ -3730,7 +3730,6 @@ void OSD::add_newly_split_pg(PG *pg, PG::RecoveryCtx *rctx) dout(10) << "Adding newly split pg " << *pg << dendl; pg->handle_loaded(rctx); - pg->write_if_dirty(*(rctx->transaction)); pg->queue_null(e, e); map >::iterator to_wake = peering_wait_for_split.find(pg->pg_id); @@ -4029,7 +4028,6 @@ int OSD::handle_pg_peering_evt( history, pi, *rctx.transaction); pg->handle_create(&rctx); - pg->write_if_dirty(*rctx.transaction); dispatch_context(rctx, pg, osdmap); dout(10) << *pg << " is new" << dendl; @@ -4064,7 +4062,6 @@ int OSD::handle_pg_peering_evt( old_past_intervals, *rctx.transaction); pg->handle_create(&rctx); - pg->write_if_dirty(*rctx.transaction); dispatch_context(rctx, pg, osdmap); dout(10) << *pg << " is new (resurrected)" << dendl; @@ -4101,7 +4098,6 @@ int OSD::handle_pg_peering_evt( *rctx.transaction ); parent->handle_create(&rctx); - parent->write_if_dirty(*rctx.transaction); dispatch_context(rctx, parent, osdmap); dout(10) << *parent << " is new" << dendl; diff --git a/src/osd/PG.cc b/src/osd/PG.cc index 05779f5eaf3..294234d7e70 100644 --- a/src/osd/PG.cc +++ b/src/osd/PG.cc @@ -5826,6 +5826,7 @@ void PG::handle_loaded(RecoveryCtx *rctx) dout(10) << "handle_loaded" << dendl; Load evt; recovery_state.handle_event(evt, rctx); + write_if_dirty(*rctx->transaction); } void PG::handle_create(RecoveryCtx *rctx) @@ -5836,6 +5837,7 @@ void PG::handle_create(RecoveryCtx *rctx) recovery_state.handle_event(evt, rctx); ActMap evt2; recovery_state.handle_event(evt2, rctx); + write_if_dirty(*rctx->transaction); } void PG::handle_query_state(Formatter *f)