]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: initialize last_pg_stats_ack correctly on first pg_stats message sending
authorxie xingguo <xie.xingguo@zte.com.cn>
Wed, 30 Mar 2016 07:30:20 +0000 (15:30 +0800)
committerxie xingguo <xie.xingguo@zte.com.cn>
Wed, 30 Mar 2016 10:01:38 +0000 (18:01 +0800)
So we don't potentially make an incorrect judgement in the tick_without_osd_lock()
procedure if OSD's first pg_stats message was sent, which as a result shall cause
an unnecessary hunting of new monitor.

Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
src/osd/OSD.cc

index e51c1191a4c5df9534f2f155c351b0c46ba720ff..823f4170d8adc6e75b589550b544403e3b131461 100644 (file)
@@ -5038,7 +5038,7 @@ void OSD::send_pg_stats(const utime_t &now)
       pg->pg_stats_publish_lock.Unlock();
     }
 
-    if (!outstanding_pg_stats.empty()) {
+    if (last_pg_stats_ack == utime_t() || !outstanding_pg_stats.empty()) {
       last_pg_stats_ack = ceph_clock_now(cct);
     }
     outstanding_pg_stats.insert(tid);