From 1f7ff412ab91689fdf6a666c50b52f07199afef5 Mon Sep 17 00:00:00 2001 From: Samuel Just Date: Mon, 1 Apr 2013 15:44:32 -0700 Subject: [PATCH] ReplicatedPG: timeout watches based on last_became_active This way a notify on an object with a single defunct watcher won't necessarily have to wait the full timeout if the pg has been active for a while. Signed-off-by: Samuel Just --- src/osd/ReplicatedPG.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc index 90f6bf5c18e..8eaec0213ff 100644 --- a/src/osd/ReplicatedPG.cc +++ b/src/osd/ReplicatedPG.cc @@ -4153,12 +4153,11 @@ void ReplicatedPG::populate_obc_watchers(ObjectContext *obc) dout(10) << "populate_obc_watchers " << obc->obs.oi.soid << dendl; assert(obc->watchers.empty()); // populate unconnected_watchers - utime_t now = ceph_clock_now(g_ceph_context); for (map, watch_info_t>::iterator p = obc->obs.oi.watchers.begin(); p != obc->obs.oi.watchers.end(); ++p) { - utime_t expire = now; + utime_t expire = info.stats.last_became_active; expire += p->second.timeout_seconds; dout(10) << " unconnected watcher " << p->first << " will expire " << expire << dendl; WatchRef watch( -- 2.47.3