From: shawn Date: Tue, 5 Jan 2016 02:28:55 +0000 (-0500) Subject: PGMonitor: acting primary diff with cur_stat, should not set pg to stale. X-Git-Tag: v10.0.3~83^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=beb99d708a5051405a32f46fc10cef473bfddce3;p=ceph.git PGMonitor: acting primary diff with cur_stat, should not set pg to stale. Signed-off-by: Xiaowei Chen --- diff --git a/src/mon/PGMonitor.cc b/src/mon/PGMonitor.cc index dc0b049dfcf2..698ec25549d9 100644 --- a/src/mon/PGMonitor.cc +++ b/src/mon/PGMonitor.cc @@ -1275,8 +1275,10 @@ void PGMonitor::_mark_pg_stale(pg_t pgid, const pg_stat_t& cur_stat) } else { stat = &q->second; } - stat->state |= PG_STATE_STALE; - stat->last_unstale = ceph_clock_now(g_ceph_context); + if (stat->acting_primary == cur_stat.acting_primary) { + stat->state |= PG_STATE_STALE; + stat->last_unstale = ceph_clock_now(g_ceph_context); + } } bool PGMonitor::check_down_pgs()