From 4c8bdc53889e977f94233fab3b05c60d1b65017e Mon Sep 17 00:00:00 2001 From: Yehuda Sadeh Date: Tue, 2 Nov 2010 16:33:24 -0700 Subject: [PATCH] osd: don't notify notifier --- src/osd/ReplicatedPG.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc index a8d50b0ea8fa6..6692c20b06c64 100644 --- a/src/osd/ReplicatedPG.cc +++ b/src/osd/ReplicatedPG.cc @@ -1130,13 +1130,16 @@ int ReplicatedPG::do_osd_ops(OpContext *ctx, vector& ops, osd->watch_lock.Lock(); osd->watch->add_notification(notif); + entity_name_t myname = ctx->op->get_source(); + for (oi_iter = oi.watchers.begin(); oi_iter != oi.watchers.end(); oi_iter++) { watch_info_t& w = oi_iter->second; dout(0) << "oi->watcher: " << oi_iter->first << " ver=" << w.ver << " cookie=" << w.cookie << dendl; iter = obc->watchers.find(oi_iter->first); - if (/* w.ver < ver && */ iter != obc->watchers.end()) { + if (/* w.ver < ver && */ iter != obc->watchers.end() && + iter->first != myname) { // don't notify the originator of this message /* found a session for registered watcher */ session = iter->second; dout(0) << " found session, sending notification" << dendl; @@ -1147,6 +1150,7 @@ int ReplicatedPG::do_osd_ops(OpContext *ctx, vector& ops, MWatchNotify *notify_msg = new MWatchNotify(w.cookie, w.ver, notif->id, WATCH_NOTIFY); osd->client_messenger->send_message(notify_msg, session->con); } else { + /* FIXME.. need to add watcher and time out accordingly */ // notif->add_watcher(oi_iter->first, Watch::WATCHER_PENDING); dout(0) << " session was not found" << dendl; } -- 2.39.5