From: Sage Weil Date: Tue, 15 Sep 2015 20:26:06 +0000 (-0400) Subject: osd: keep count of outstanding pg stat updates to mon X-Git-Tag: v10.0.1~26^2~59 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=ae1cae027df1ecf3c66dc13def87c95f7abd8207;p=ceph.git osd: keep count of outstanding pg stat updates to mon Count how many stat updates we have in flight. Signed-off-by: Sage Weil --- diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc index cbf6bbfc212..677c1cd6570 100644 --- a/src/osd/OSD.cc +++ b/src/osd/OSD.cc @@ -1567,7 +1567,7 @@ OSD::OSD(CephContext *cct_, ObjectStore *store_, debug_drop_pg_create_duration(cct->_conf->osd_debug_drop_pg_create_duration), debug_drop_pg_create_left(-1), stats_ack_timeout(cct->_conf->osd_mon_ack_timeout), - outstanding_pg_stats(false), + outstanding_pg_stats(0), up_thru_wanted(0), up_thru_pending(0), requested_full_first(0), requested_full_last(0), @@ -3998,7 +3998,7 @@ void OSD::tick() stats_ack_timeout = MAX(g_conf->osd_mon_ack_timeout, stats_ack_timeout * g_conf->osd_stats_ack_timeout_factor); - outstanding_pg_stats = false; + outstanding_pg_stats = 0; } if (now - last_pg_stats_sent > cct->_conf->osd_mon_report_interval_max) { osd_stat_updated = true; @@ -4784,9 +4784,12 @@ void OSD::send_pg_stats(const utime_t &now) } if (!outstanding_pg_stats) { - outstanding_pg_stats = true; last_pg_stats_ack = ceph_clock_now(cct); } + ++outstanding_pg_stats; + dout(20) << __func__ << " " << outstanding_pg_stats << " updates pending" + << dendl; + monc->send_mon_message(m); } @@ -4842,10 +4845,14 @@ void OSD::handle_pg_stats_ack(MPGStatsAck *ack) << ":" << pg->pg_stats_publish.reported_seq << dendl; } } - + + assert(outstanding_pg_stats > 0); + --outstanding_pg_stats; if (!pg_stat_queue.size()) { - outstanding_pg_stats = false; + assert(outstanding_pg_stats == 0); } + dout(20) << __func__ << " " << outstanding_pg_stats << " updates pending" + << dendl; pg_stat_queue_lock.Unlock(); diff --git a/src/osd/OSD.h b/src/osd/OSD.h index b49cf767ce9..66257f62dbe 100644 --- a/src/osd/OSD.h +++ b/src/osd/OSD.h @@ -1971,7 +1971,7 @@ protected: */ utime_t last_pg_stats_ack; float stats_ack_timeout; - bool outstanding_pg_stats; // some stat updates haven't been acked yet + int outstanding_pg_stats; // how many stat updates haven't been acked yet void do_mon_report();