]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
ReplicatedPG: timeout watches based on last_became_active
authorSamuel Just <sam.just@inktank.com>
Mon, 1 Apr 2013 22:44:32 +0000 (15:44 -0700)
committerSamuel Just <sam.just@inktank.com>
Wed, 24 Apr 2013 03:54:57 +0000 (20:54 -0700)
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 <sam.just@inktank.com>
src/osd/ReplicatedPG.cc

index 90f6bf5c18ea430e3f5757aef1d6ceca04dbea5c..8eaec0213ffdf25ea4fe6e6277313b9313155f8e 100644 (file)
@@ -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<pair<uint64_t, entity_name_t>, 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(