From: Samuel Just Date: Mon, 1 Apr 2013 22:44:32 +0000 (-0700) Subject: ReplicatedPG: timeout watches based on last_became_active X-Git-Tag: v0.61~105^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=1f7ff412ab91689fdf6a666c50b52f07199afef5;p=ceph.git 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 --- diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc index 90f6bf5c18ea..8eaec0213ffd 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(