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: v11.2.1~172^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=d8c0141a7506cd38d385270f5a1cf315d808974e;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 (cherry picked from commit d4adeb7500a113097fdd717ada0231f68badafbb) --- diff --git a/src/osd/PG.cc b/src/osd/PG.cc index 2e03e10be0e..7a2fb1c6822 100644 --- a/src/osd/PG.cc +++ b/src/osd/PG.cc @@ -6215,6 +6215,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 @@ -6268,6 +6269,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()); } @@ -6333,6 +6335,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(); @@ -6353,6 +6356,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() @@ -6369,6 +6373,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 @@ -6582,6 +6588,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() @@ -6641,6 +6648,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(); }