]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/PG: move write_if_dirty inside handle_{loaded,create}
authorSage Weil <sage@redhat.com>
Sun, 17 Sep 2017 22:37:36 +0000 (17:37 -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

index f64667a6f91c8bed4bc37ffea2327d1c680fd605..2ee9b5130b7df921869cc379b559bf34bef9738a 100644 (file)
@@ -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<spg_t, list<PG::CephPeeringEvtRef> >::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;
index 05779f5eaf366dce61e1a28de11e89f5d9f43f71..294234d7e70801d6cdbee3564de98a18359e88b3 100644 (file)
@@ -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)