From: Sage Weil Date: Fri, 30 Dec 2016 22:28:59 +0000 (-0500) Subject: osd/PG: publish PG stats when backfill-related states change X-Git-Tag: v12.0.0~251^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=d4adeb7500a113097fdd717ada0231f68badafbb;p=ceph.git osd/PG: publish PG stats when backfill-related states change These frequently get flushed because other updates happen, but we should explicitly ensure that the mon sees these state changes. Fixes: http://tracker.ceph.com/issues/18369 Signed-off-by: Sage Weil --- diff --git a/src/osd/PG.cc b/src/osd/PG.cc index b63d1d789f581..9e3ff68c272cb 100644 --- a/src/osd/PG.cc +++ b/src/osd/PG.cc @@ -6043,6 +6043,7 @@ PG::RecoveryState::Backfilling::Backfilling(my_context ctx) pg->state_clear(PG_STATE_BACKFILL_TOOFULL); pg->state_clear(PG_STATE_BACKFILL_WAIT); pg->state_set(PG_STATE_BACKFILL); + pg->publish_stats_to_osd(); } boost::statechart::result @@ -6096,6 +6097,7 @@ PG::RecoveryState::WaitRemoteBackfillReserved::WaitRemoteBackfillReserved(my_con context< RecoveryMachine >().log_enter(state_name); PG *pg = context< RecoveryMachine >().pg; pg->state_set(PG_STATE_BACKFILL_WAIT); + pg->publish_stats_to_osd(); post_event(RemoteBackfillReserved()); } @@ -6161,6 +6163,7 @@ PG::RecoveryState::WaitRemoteBackfillReserved::react(const RemoteReservationReje pg->state_clear(PG_STATE_BACKFILL_WAIT); pg->state_set(PG_STATE_BACKFILL_TOOFULL); + pg->publish_stats_to_osd(); pg->schedule_backfill_full_retry(); @@ -6181,6 +6184,7 @@ PG::RecoveryState::WaitLocalBackfillReserved::WaitLocalBackfillReserved(my_conte pg, pg->get_osdmap()->get_epoch(), LocalBackfillReserved()), pg->get_backfill_priority()); + pg->publish_stats_to_osd(); } void PG::RecoveryState::WaitLocalBackfillReserved::exit() @@ -6197,6 +6201,8 @@ PG::RecoveryState::NotBackfilling::NotBackfilling(my_context ctx) NamedState(context< RecoveryMachine >().pg->cct, "Started/Primary/Active/NotBackfilling") { context< RecoveryMachine >().log_enter(state_name); + PG *pg = context< RecoveryMachine >().pg; + pg->publish_stats_to_osd(); } boost::statechart::result @@ -6411,6 +6417,7 @@ PG::RecoveryState::WaitLocalRecoveryReserved::WaitLocalRecoveryReserved(my_conte pg, pg->get_osdmap()->get_epoch(), LocalRecoveryReserved()), pg->get_recovery_priority()); + pg->publish_stats_to_osd(); } void PG::RecoveryState::WaitLocalRecoveryReserved::exit() @@ -6470,6 +6477,7 @@ PG::RecoveryState::Recovering::Recovering(my_context ctx) PG *pg = context< RecoveryMachine >().pg; pg->state_clear(PG_STATE_RECOVERY_WAIT); pg->state_set(PG_STATE_RECOVERING); + pg->publish_stats_to_osd(); pg->queue_recovery(); }