]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: send notify message only to unexpired watchers
authorYehuda Sadeh <yehuda@hq.newdream.net>
Thu, 16 Dec 2010 00:33:02 +0000 (16:33 -0800)
committerYehuda Sadeh <yehuda@hq.newdream.net>
Thu, 16 Dec 2010 00:33:42 +0000 (16:33 -0800)
src/osd/ReplicatedPG.cc

index eae2d8d42486910eb02f93b12eb39e5e9e6e27c8..966c1a60c4e7b0e7ef2a7853c0968768e4ecafb8 100644 (file)
@@ -1182,11 +1182,14 @@ int ReplicatedPG::do_osd_ops(OpContext *ctx, vector<OSDOp>& ops,
        }
 
        // unconnected
+       utime_t now = g_clock.now();
        for (map<entity_name_t, utime_t>::iterator p = obc->unconnected_watchers.begin();
             p != obc->unconnected_watchers.end();
             p++) {
          entity_name_t name = p->first;
-         notif->add_watcher(name, Watch::WATCHER_PENDING);
+          utime_t expire = p->second;
+          if (now < expire)
+           notif->add_watcher(name, Watch::WATCHER_PENDING); /* FIXME: should we remove expired unconnected? probably yes */
        }
 
        notif->reply = new MWatchNotify(op.watch.cookie, op.watch.ver, notif->id, WATCH_NOTIFY_COMPLETE);